Show TOC

 Switching Between Chart and Table Using a PushbuttonLocate this document in the navigation structure

You display a chart in your Web application. You want to allow the user to display the data as a chart or table by using "Display Table" and "Display Chart" pushbuttons. Since the same pushbutton has to change its action, you cannot depict the use case with a single pushbutton. You need a second pushbutton to implement the use case.

  1. Insert the Analysis Web item into your Web template that includes the Chart Web item; assign the same data provider to the Analysis Web item and set the required parameters. Set this Web item to Hidden initially.
  2. Insert the Button Group Web item into your Web template. In the first row of the pushbutton list, enter "Display Table" for Caption.
  3. Insert a second Button Group Web item into your Web template. In the first row of the pushbutton list, enter "Display Chart" for Caption. Set the Button Group Web item to Hidden initially.
  4. You can now specify the following command sequence for the Command of the first Web item, Button Group: Hide Chart → Hide First Button Group Web Item → Show Analysis Web Item Visible → Show Second Button Group Web Item.

    Proceed as follows:

    1. Under Command, use the pushbutton to call the command wizard (see Commands ).
    2. On the All Commands tab page, choose Commands for Web Items. Select the command Set Web Item Parameters (SET_ITEM_PARAMETERS) and double-click to choose it.
    3. Select the Chart Web item as the target Web item and set the Visibility parameter (VISIBILITY) to Hidden (HIDDEN).
    4. Choose Next Command and Insert to create a new command for the command sequence.
    5. Choose the Set Web Item Parameters (SET_ITEM_PARAMETERS) command again and specify the first Button Group Web item as the target Web item and set the Visibility (VISIBILITY) parameter to Hidden.
    6. Choose Next Command and Insert to create a new command for the command sequence.
    7. Choose the Set Web Item Parameters (SET_ITEM_PARAMETERS) command again and specify the first Analysis Web item as the target Web item and set the Visibility (VISIBILITY) parameter to Visible.
    8. Choose Next Command and Insert to create a new command for the command sequence.
    9. Choose the Set Web Item Parameters (SET_ITEM_PARAMETERS) command again and specify the second Button Group Web item as the target Web item and set the Visibility (VISIBILITY) parameter to Visible.
  5. For the second Button Group Web item, proceed from step 4.a. Swap the value assignments Visible/Hidden for the Visibility (VISIBILITY) parameter.

Sample Code

Below is the complete sample code from the XHTML view of the Web Application Designer:

<bi:bisp  xmlns="http://www.w3.org/TR/REC-html40" xmlns:bi="http://xml.sap.com/2005/01/bi/wad/bisp" xmlns:jsp="http://java.sun.com/JSP/Page" >

<html >

<head >

<title >Netweaver BI Web Application</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</head>

<body >

<bi:QUERY_VIEW_DATA_PROVIDER name="DP_1" >

<bi:INITIAL_STATE type="CHOICE" value="QUERY" >

<bi:QUERY value="YOURQUERY" text="Type" />

</bi:INITIAL_STATE>

</bi:QUERY_VIEW_DATA_PROVIDER>

<bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" />

<p >

<br />

<bi:BUTTON_GROUP_ITEM name="BUTTON_GROUP_ITEM_1" designheight="70" designwidth="200" >

<bi:BUTTON_LIST type="ORDEREDLIST" >

 <bi:BUTTON type="COMPOSITE" index="1" >

<bi:CAPTION value="Show Table" />

<bi:ACTION type="CHOICE" value="INSTRUCTION" >

<bi:INSTRUCTION >

 <bi:SET_ITEM_PARAMETERS >

<bi:cmd_item_parameters type="CHART_ITEM" >

<bi:VISIBILITY value="HIDDEN" />

</bi:cmd_item_parameters>

 <bi:TARGET_ITEM_REF value="CHART_ITEM_1" />

</bi:SET_ITEM_PARAMETERS>

<bi:SET_ITEM_PARAMETERS >

<bi:cmd_item_parameters type="BUTTON_GROUP_ITEM" >

<bi:VISIBILITY value="HIDDEN" />

</bi:cmd_item_parameters>

<bi:TARGET_ITEM_REF value="BUTTON_GROUP_ITEM_1" />

 </bi:SET_ITEM_PARAMETERS>

<bi:SET_ITEM_PARAMETERS >

<bi:cmd_item_parameters type="ANALYSIS_ITEM" >

<bi:VISIBILITY value="VISIBLE" />

</bi:cmd_item_parameters>

<bi:TARGET_ITEM_REF value="ANALYSIS_ITEM_1" />

</bi:SET_ITEM_PARAMETERS>

<bi:SET_ITEM_PARAMETERS >

<bi:cmd_item_parameters type="BUTTON_GROUP_ITEM" >

<bi:VISIBILITY value="VISIBLE" />

</bi:cmd_item_parameters>

 <bi:TARGET_ITEM_REF value="BUTTON_GROUP_ITEM_2" />

</bi:SET_ITEM_PARAMETERS>

</bi:INSTRUCTION>

</bi:ACTION>

</bi:BUTTON>

</bi:BUTTON_LIST>

</bi:BUTTON_GROUP_ITEM>

<bi:BUTTON_GROUP_ITEM name="BUTTON_GROUP_ITEM_2" designheight="70" designwidth="200" >

<bi:BUTTON_LIST type="ORDEREDLIST" >

<bi:BUTTON type="COMPOSITE" index="1" >

<bi:CAPTION value="Show Chart" />

<bi:ACTION type="CHOICE" value="INSTRUCTION" >

<bi:INSTRUCTION >

<bi:SET_ITEM_PARAMETERS >

 <bi:cmd_item_parameters type="CHART_ITEM" >

<bi:VISIBILITY value="VISIBLE" />

</bi:cmd_item_parameters>

<bi:TARGET_ITEM_REF value="CHART_ITEM_1" />

</bi:SET_ITEM_PARAMETERS>

<bi:SET_ITEM_PARAMETERS >

<bi:cmd_item_parameters type="BUTTON_GROUP_ITEM" >

 <bi:VISIBILITY value="VISIBLE" />

</bi:cmd_item_parameters>

<bi:TARGET_ITEM_REF value="BUTTON_GROUP_ITEM_1" />

</bi:SET_ITEM_PARAMETERS>

 <bi:SET_ITEM_PARAMETERS >

<bi:cmd_item_parameters type="ANALYSIS_ITEM" >

<bi:VISIBILITY value="HIDDEN" />

</bi:cmd_item_parameters>

<bi:TARGET_ITEM_REF value="ANALYSIS_ITEM_1" />

</bi:SET_ITEM_PARAMETERS>

<bi:SET_ITEM_PARAMETERS >

<bi:cmd_item_parameters type="BUTTON_GROUP_ITEM" >

<bi:VISIBILITY value="HIDDEN" />

</bi:cmd_item_parameters>

<bi:TARGET_ITEM_REF value="BUTTON_GROUP_ITEM_2" />

</bi:SET_ITEM_PARAMETERS>

</bi:INSTRUCTION>

</bi:ACTION>

</bi:BUTTON>

</bi:BUTTON_LIST>

</bi:BUTTON_GROUP_ITEM>

 <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_1" designwidth="400" designheight="200" >

<bi:DATA_PROVIDER_REF value="DP_1" />

<bi:VISIBILITY value="HIDDEN" />

</bi:ANALYSIS_ITEM>

<bi:CHART_ITEM name="CHART_ITEM_1" designheight="200" designwidth="400" >

<bi:DATA_PROVIDER_REF value="DP_1" />

</bi:CHART_ITEM>

<br />

<br />

</p>

</p>

</body>

</html>

</bi:bisp>