Working with Dojo widgets

Customizing a HATS Dojo widget

When you first add a host component rendered by a HATS Dojo widget to a transformation .jsp file, the component and widget selections are defined within a <HATS:Component> tag. For more information about the <HATS:Component> tag, see HATS component tag and attributes. If the HATS default widget definitions meet you needs, then this is all that is required.

The example below shows a Command line component rendered by a HATS default Dojo Combo box widget.

Figure 2. HATS default Dojo Combo Box widget
Default Combo Box widget with three values in list

In the transformation .jsp file this default component and widget are defined within a <HATS:Component> tag as shown below.

<HATS:Component
   type="com.ibm.hats.transform.components.CommandLineComponent"
   componentSettings="" 
	row="20" col="7" erow="20" ecol="21"
   alternate=""
	widget="com.ibm.hats.transform.widgets.dojo.ComboBoxWidget"
   widgetSettings="stringListItems:Boats=boats;JK=strqm;Sign Off=90;
    |autoSubmitOnSelect:false|useString:true|"
	alternateRenderingSet=""  textReplacement="" />

If you want to customize a HATS Dojo widget to add function in addition to what is provided using the defaults, you must first transform the component and widget definitions. To do this, select the <HATS:Component> tag, right-click, and select HATS Tools > Transform for Dojo Editing. The Transform for Dojo Editing wizard transforms the <HATS:Component> tag to a <HATS:Render> tag. The example below shows the <HATS:Component> tag above after being transformed to a <HATS:Render> tag.

<HATS:Render 

<!-- Start of component settings -->
type="com.ibm.hats.transform.components.CommandLineComponent"
componentSettings=""
row="20" col="7" erow="20" ecol="21"
textReplacement="">
<!-- End of component settings -->

<!-- Start of ComboBoxWidget -->
<!-- com.ibm.hats.transform.widgets.dojo.ComboBoxWidget -->

<!-- Start of JSON data source -->

<!-- Start of JSON data for the component element -->
<script>var HATSJSON_<HATS:ElementId/> = <HATS:JSON/>;</script>
<!-- End of JSON data for the component element -->

<!-- Start of JSON widget settings -->
<script>var DOJOWidgetSettings_<HATS:ElementId/> = 
{"type":"ComboBoxWidget",
"value":{"stringListItems":"Boats=boats;JK=strqm;Sign Off=90;",
         "autoSubmitOnSelect":"false","useString":"true"
}
};
<!-- End of JSON widget settings -->
</script>
<!-- End of JSON data source -->

<!-- Start of rendered widget -->
<div id="<HATS:ElementId/>">
<label for id="<HATS:ElementId/>_input" 
           id="<HATS:ElementId/>_label"></label>
<input id="<HATS:ElementId/>_input"></input>
</div>	
<!-- End of rendered widget -->

<!-- Start of data binding -->
<script type="text/javascript" 
        src="../common/hatsdojo/hsr_comboboxwidget.js">
</script>
<script type="text/javascript">	
if (HATSJSON_<HATS:ElementId/> && (HATSJSON_<HATS:ElementId/>.value){
   dojo.addOnLoad(function(){
   var uLabel = dojo.byId("<HATS:ElementId/>_label");
   var jsonData = (HATSJSON_<HATS:ElementId/>;
   var widgetSettings = DOJOWidgetSettings_<HATS:ElementId/>;
 	var jsonList = getListItemsFromJSONData(jsonData, 
     getListItemsFromHATSWidgetSettings(widgetSettings));
	var storeList = new dojo.data.ItemFileReadStore(
          {data: {identifier:"value", 
                  items:createUniqueItemsList(jsonList,"value")
              }
          }
);
	var uComboBoxWidget = new dijit.form.ComboBox(
         {name:getPosLengthStringFromJSONData(jsonData),
          store:storeList,searchAttr:"fullName"
         },
          "<HATS:ElementId/>_input"
);
  //load the JSON information and behavior into the Widget
		bindJSONDataToComboBox(uLabel, uComboBoxWidget, 
        jsonData, widgetSettings);
		setInputFieldFocus();
	  });
	}
</script>
<!-- End of data binding -->

<!-- /com.ibm.hats.transform.widgets.dojo.ComboBoxWidget -->
<!-- End of ComboBoxWidget -->

</HATS:Render>

Notice in the example above, comments have been added to separate different sections of the <HATS:Render> tag. These sections are described below.

Component settings

These settings are the same as on the <HATS:Component> tag. For descriptions, see HATS component tag and attributes.

Widget settings

The widget settings are contained in a JavaScript Object Notation (JSON) object and used in the creation and binding of the Dojo widget in JavaScript for behaviors, options, and default values.

<HATS:ElementId/> creates a unique identity for the rendered component element at runtime.

<HATS:JSON/> creates the actual JSON object at runtime.

JSON data source

The JSON data source is created from the ComponentElements using a toJSON() method. This JSON data is used to bind the Dojo widget to HATS data. More information can be found in the APIs for the ComponentElements. See Using the API documentation (Javadoc).

Rendered widget

The rendered widget is the base HTML and JavaScript that is changed at Dojo load time to create a HATS Dojo widget.

Data binding

The data binding uses the settings and data provided to change the rendered widget into a HATS Dojo widget. This typically includes providing the Dojo widget event behaviors such as focus and selection, default values, and any options, settings, or data necessary for correct operation and layout.

HATS Dojo widget customization examples

The following sections include examples of customized HATS Dojo widgets. For more information about these and other Dojo widgets, see the Dojo Toolkit API documentation at http://dojotoolkit.org/api/.

Combo box

This example shows various ways to customize a HATS Dojo Combo box widget.

Start by creating a Combo box widget, for example, for the From City input field on the following host screen for the Flights Reservation System application.

Figure 3. Host screen for the Flights Reservation System
Host screen for the Flights Reservation System

When creating the Combo box widget use the Fill from string setting to specify the List items to fill the drop-down list. In this example, use the following string of city names:

Albany;Albuquerque;Atlanta;Boston;Chicago;Dallas;Los Angeles;Miami;
Montreal;Raleigh;Rochester, MN;Salt Lake City;San Diego;Toronto;Vancouver;Washington DC

After you create the Input field component rendered with the Combo box widget, the widget appears on the transformation .jsp file as shown below:

Figure 4. Dojo Combo box widget with list of cities
Dojo Combo box widget with list of cities

When you preview or run this example, type the letters, al, into the Combo box. Notice that all of the cities that contain the letters, al, are displayed in the drop-down list.

Figure 5. Dojo Combo box widget with filtered list of cities
Dojo Combo box widget with filtered list of cities

To customize the Combo box widget so that only cities that start with the typed letters are display in the drop-down list, edit the transformation .jsp file and perform the following steps:

  1. Locate the <HATS:Component> tag in the transformation .jsp file. Below is the source code that is created for this example.
    <HATS:Component 
        type="com.ibm.hats.transform.components.InputComponent" 
          componentSettings="" textReplacement=""
          row="12" erow="12" col="17" ecol="32"
    	  widget="com.ibm.hats.transform.widgets.dojo.ComboBoxWidget"
    	    widgetSettings="stringListItems:Albany;Albuquerque;Atlanta;Boston;Chicago;Dallas;
          Los Angeles;Miami;Montreal;Raleigh;Rochester, MN;Salt Lake City;San Diego;
          Toronto;Vancouver;Washington DC|
          autoSubmitOnSelect:false|useString:true|" alternate="" alternateRenderingSet="" />										  
  2. Select the <HATS:Component> tag, right-click, and select HATS Tools > Transform for Dojo Editing. This transforms the <HATS:Component> tag to a <HATS:Render> tag.
  3. Referring to the Dojo API, for example, at http://dojotoolkit.org/api/1.5/dijit/form/ComboBox, you see that the queryExpr property controls how to match entries in the drop-drop list. The expression, ${0}*, can be used to display only list entries that start with the characters that the user types. Within the <HATS:Render> tag, notice that the widget variable is named, uComboBoxWidget. To customize your widget to display only cities that start with the typed letters, following the setInputFieldFocus(); statement add the statement shown below:
    setInputFieldFocus();
    uComboBoxWidget.queryExpr = "\${0}*";
    Note:
    Notice the backslash (\) before the queryExpr property ${0}*. This prevents the JSP translator from processing it as Expression Language (EL) syntax.

Now when you preview or run this example, and type the letters, al, into the Combo box, notice that only cities that start with these letters are displayed in the drop-down list.

Figure 6. Dojo Combo box using starting-with list of cities
Dojo Combo box using starting-with list of cities

The Combo box widget also supports validation of user-supplied input. Again, referring to the Dojo API documentation, you see that the regExp property can be used to restrict the format of user-supplied input. For example, if you want to specify that no numbers are allowed in the user’s input, following the statement you added in the previous example, add the statement shown below:

uComboBoxWidget.regExp = "[^0-9]*";

In addition, if you want to add a prompt message and change the text of the default invalid value message , add the final two statements shown below:

setInputFieldFocus();
uComboBoxWidget.queryExpr = "\${0}*";
uComboBoxWidget.regExp = "[^0-9]*";
uComboBoxWidget.promptMessage = "Please enter the departure city.";
uComboBoxWidget.invalidMessage = "Numeric characters are not allowed.";

Now when you preview or run this example, notice your prompt message is displayed when you position the cursor in the combo box.

Figure 7. Dojo Combo box prompt message
Dojo Combo box prompt message

Type a value containing a number. Notice your invalid message is displayed, and the combo box changes color and displays a warning icon.

Figure 8. Dojo Combo box invalid message
Dojo Combo box invalid message

Enhanced grid

This example shows how to change the HATS Enhanced grid widget to add a single-selection radio button for each row in the table.

Start by creating an Enhanced grid widget, for example, for a table similar to the one shown on the following host screen.

Figure 9. Work with Active Jobs host screen
Work with Active Jobs host screen

After you create a Table component rendered with an Enhanced grid widget, the widget appears on the transformation .jsp file as shown below.

Note:
This figure shows the widget appearance when using the Dojo Claro theme. The widget might appear differently when using a different Dojo theme.
Figure 10. Dojo Enhanced grid widget
Dojo Enhanced grid widget

To change the indirectSelection plug-in to provide a single-selection radio button for each row, edit the transformation .jsp file and perform the following steps:

  1. Locate the <HATS:Component> tag in the transformation .jsp file. Select the tag, then right-click and select HATS Tools > Transform for Dojo Editing. This transforms the <HATS:Component> tag to a <HATS:Render> tag.
  2. Locate and change the grid variable as shown below:
    var grid = new dojox.grid.EnhancedGrid(
    		{
    			autoWidth: true,
    			autoHeight: true,
    			structure: tableHeader,
    			plugins: {nestedSorting: true, dnd: true, indirectSelection: true},
          selectionMode: "single"
    		},
    		document.createElement('div')
    	);

The Enhanced grid widget now appears on the transformation .jsp file as shown below. In this example, single-selection radio buttons are added to each row in the table. The selected row can be dragged to another location in the table.

Figure 11. Dojo Enhanced grid widget with single row select
Dojo Enhanced grid widget with single row select

Filtering select

This example shows how to fill the drop-down list of a HATS Dojo Filtering select widget from a global variable.

Start by creating a Filtering select widget, for example, for the Account number input field on the following host screen for the Accounts application.

Figure 12. Host screen with account number input field
Host screen with account number input field

After you create an Input field component rendered with a Filtering select widget, the widget appears on the transformation .jsp file as shown below:

Figure 13. Dojo Filtering select widget
Dojo Filtering select widget

Edit the transformation .jsp file and perform the following steps:

  1. Locate the <HATS:Component> tag in the transformation .jsp file. Below is the source code that is created for this example.
    <HATS:Component 
    	  type="com.ibm.hats.transform.components.InputComponent"
    		 componentSettings="" textReplacement=""
          row="11" erow="11" col="22" ecol="26"
    	  widget="com.ibm.hats.transform.widgets.dojo.FilteringSelectWidget"
    		 widgetSettings="" alternate="" alternateRenderingSet="" /> 
  2. Select the <HATS:Component> tag, right-click, and select HATS Tools > Transform for Dojo Editing. This transforms the <HATS:Component> tag to a <HATS:Render> tag.
  3. Position the cursor after the last </script> tag in the .jsp source. Right-click and select HATS Tools > Insert Global Variable.
  4. On the Insert Global Variable window, select the global variable whose contents contains the data to fill the Filtering select drop-down list. In this example, a global variable named acctnumGV contains the text, 10011;10012;10013;10014, which are valid account numbers for this application and are in the same format, separated by a semicolon (;), used by the List items setting of the Filtering select widget.
  5. One result of using the Insert Global Variable tool is to add the following import statement before the <html> tag in the .jsp source.
    <%@page import="com.ibm.hats.common.*"%>
    <html>
  6. A second result is to add the following statement at the cursor location, in this case, after the last </script> tag in the .jsp source.
    <%= ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO))
    .getGlobalVariable("acctnumGV", true).getString(0) %>
  7. Within the <HATS:Render> tag, locate the creation of the jsonList variable. Following this statement, add statements to create a gvString variable and then add the items in the gvString variable to the jsonList variable. To initialize the gvString variable, cut and paste the statement added by the Insert Global Variable tool following the </script> tag. When complete, the code should be as shown below.
    var jsonList = getListItemsFromJSONData(jsonData, getListItemsFromHATSWidgetSettings(widgetSettings));
    var gvString = '<%= ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO))
     .getGlobalVariable("acctnumGV", true).getString(0) %>';
    jsonList = getListItemsFromString(gvString, jsonList);
    var storeList = new dojo.data.ItemFileReadStore({data: {identifier:"value", 
     items:createUniqueItemsList(jsonList,"value")}});

The Filtering select widget now appears on the transformation .jsp file as shown below. In this example, the drop-down list contains the set of valid account numbers provided by the accountNum global variable.

Figure 14. Dojo Filtering select widget using global variable
Dojo Filtering select widget using global variable

Number spinner

This example shows how to create a Number spinner Dojo widget to use for the same Account number input field used in the Filtering select example. See Figure 12.

Start by creating a HATS Text box Dojo widget to render the input field.

After you create an Input field component rendered with a Text box widget, the widget appears on the transformation .jsp file as shown below:

Figure 15. Dojo Text box widget
Dojo Text box widget

Edit the transformation .jsp file and perform the following steps:

  1. Add a dojo.require statement for the Number spinner widget as shown in the example below.
    <script type="text/javascript">
    dojo.require("dojo.parser");
    dojo.require("dijit.form.TextBox");
    dojo.require("dijit.form.NumberSpinner");
    </script>
  2. Locate the <HATS:Component> tag in the transformation .jsp file. Below is the source code that is created for this example.
    <HATS:Component  
    	  type="com.ibm.hats.transform.components.InputComponent" 
          componentSettings="" textReplacement="" BIDIOpposite="false"
          row="11" erow="11" col="22" ecol="26"
        widget="com.ibm.hats.transform.widgets.dojo.TextBoxWidget"
    	     widgetSettings="" alternate="" alternateRenderingSet="" /> 
  3. Select the <HATS:Component> tag, right-click, and select HATS Tools > Transform for Dojo Editing. This transforms the <HATS:Component> tag to a <HATS:Render> tag.
  4. Within the <HATS:Render> tag, locate where the Text box widget is created. Comment out (or remove) the creation of the Text box widget and create a Number spinner widget as shown below.
    // comment out the original text box code
    // var uInputWidget = new 
    // dijit.form.TextBox({"type":inputType},"<HATS:ElementId/>_input");
    var uInputWidget = new 
    dijit.form.NumberSpinner({"smallDelta":1,"constraints":
    {"min":10011,"max":10037,"places":0},"required":"true"},
    "<HATS:ElementId/>_input");

The Number spinner widget now appears on the transformation .jsp file as shown below. In this example, the min and max options are set to match the correct range of account numbers for this particular application.

Figure 16. Dojo Number spinner widget
Dojo Number spinner widget

Using the Dojo TabContainer widget

HATS tabbed folder support is deprecated in HATS V9.7. While support for tabbed folders continues for now, IBM reserves the right to remove this capability in a subsequent release of the product. One alternative is to use the TabContainer Dojo Layout widget to create tabs and use HATS widgets to render host components within the tabs.

Using the Dojo TabContainer widget in a HATS Web project

The example that follows shows using the Dojo TabContainer widget in a HATS Web project to render the data on the Display Report host screen in two tabs, one using the HATS Dojo Enhanced grid widget and the other using the HATS Graph widget.

To use the Dojo TabContainer widget in this example, follow these steps:

  1. Create a HATS Web project with the Use Dojo technology option selected.
  2. Start the Host Terminal, navigate to the first screen of the report and click Create HATS Screen Customization on the toolbar.
  3. On the Screen Customization page, accept the defaults and click Next.
  4. On the Screen Recognition Criteria page, specify how to identify the screen and click Next.
  5. On the Actions page, accept the defaults and click Finish. The transformation .jsp file opens in the Page Designer along with the Insert Host Component wizard.
  6. Click Cancel on the Insert Host Component wizard.
  7. From the Palette view, under Dojo Layout Widgets, select TabContainer and drop it to the transformation .jsp design area.
  8. In the Insert Tab Container dialog, specify 2 for the Number of tabs and click OK.
  9. In the Properties view for the tabs, or the Source view, change the titles of the tabs. Change Tab1 to Table and Tab2 to Graph.
  10. From the Palette view, under HATS Components, select Table (visual) and drop it to the Table pane.
  11. In the Insert Host Component wizard, on the Screen Region page, select the screen region to be displayed as a visual table. For this example, select the region including the four columns of data and the dashed lines above the first row of data.
  12. On the Rendering Options page, select Table (visual) from the Components list and click the Component Settings button.
  13. On the Settings - Table (visual) page, clear the Use project defaults box, set Rows to exclude to 1, select Extract column header test from row above table and click OK.
  14. On the Rendering Options page, select Enhanced grid (Dojo) from the list of widgets and click Finish.
  15. Press Ctrl-S to save your work so far.
  16. From the Palette view, under HATS Components, select Table (visual) and drop it to the Graph pane.
    Note:
    If you have difficulty switching to the Graph pane in the Design view, drop the Table (visual) component to before the </div> tag for the Graph pane in the Source view.
  17. In the Insert Host Component wizard, on the Screen Region page, select the same region you selected for the Table pane.
  18. On the Rendering Options page, select Table (visual) from the Components list and click the Component Settings button.
  19. On the Settings - Table (visual) page, clear the Use project defaults box, set Rows to exclude to 1, select Extract column header test from row above table and click OK.
  20. On the Rendering Options page, select Graph (horizontal bar) from the list of widgets and click the Widget Settings button.
  21. On the Settings - Graph (horizontal bar) page:
    1. Clear the Use project defaults box.
    2. Set the Number of data sets to 1.
    3. Type Inventory for the X-axis title.
    4. Type Part Name for the Y-axis title.
    5. Under Extract data point labels, set Column to 2.
    6. Click Data sets.
  22. On the Data Source Settings page, set Data set 1, column to 3, select Orange in the Color drop-down, delete the legend label, and click OK.
  23. On the Settings - Graph (horizontal bar) page, click OK.
  24. On the Rendering Options page, click Finish.
  25. Press Ctrl-S to save your work.
  26. In the Page Designer, click the Preview tab to see a preview of your transformation.
  27. Run the project. You can adjust the height and width of the TabContainer widget to get the desired display at runtime. Note that you must use fixed height and width on the TabContainer widget in case the tabbed folder is not displayed at runtime.

Below is the source for the table area containing the TabContainer in this example.

<!-- Insert your HATS component tags here. -->

<table width="783" height="500" cellspacing="0" cellpadding="0" border="0">
   <!-- flm:table -->
   <tbody>
         <tr>
            <td height="31" width="12"></td>
            <td width="771"></td>
         </tr>
         <tr>
            <td height="469"></td>
            <!-- flm:cell -->
            <td valign="top">
            <div id="TabContainer" dojoType="dijit.layout.TabContainer"
	                tabposition="top" style="height: 469px; width: 771px">
            <div dojoType="dijit.layout.ContentPane" title="Table" id="Tab1">
                 <HATS:Component
	                    row="7" erow="16" col="14" ecol="77" 
                       alternate="" alternateRenderingSet="" textReplacement=""
	                    widget="com.ibm.hats.transform.widgets.dojo.EnhancedGridWidget"
	                     widgetSettings=""
	                    type="com.ibm.hats.transform.components.VisualTableComponent"
	                     componentSettings="minRows:1|validateCharacterType:false|
                        includePreviousLineAsHeader:true|columnBreaks:|minColumns:1|
                        behaveAsInDefaultRendering:false|areaAsInDefaultRendering:false|
                        overrideRecognitionBehavior:false|evaluateBetterTableParameter:numberOfCells|
                        excludeCols:|numberOfTitleRows:0|columnDelimiter: |
                        betterTableHasLeastOfParameter:false|includeEmptyRows:true|
                        excludeRows:1|" />
            </div>
            <div dojoType="dijit.layout.ContentPane" title="Graph" id="Tab2">
                 <HATS:Component
	                    row="7" erow="16" col="14" ecol="77" 
                       alternate="" alternateRenderingSet="" textReplacement=""
	                    widget="com.ibm.hats.transform.widgets.HorizontalBarGraphWidget"
	                     widgetSettings="extractSource:col|backgroundImage:|dataSource1Color:#ff8040|
                        backgroundColor:#ffffff|extractLabels:true|dataSource3Legend:Series 3|
                        dataSource2Color:#00ff00|yAxisTitle:Part Name|textAntialiasing:true|
                        labelIndex:2|extractDataSetLabels:false|height:400|alternateText:Graph.jpg|
                        width:400|dataSource3:3|defaultFont:SansSerif-PLAIN-12|dataSource2:2|
                        dataSource1:3|dataSetNumber:1|dataSource2Legend:Series 2|
                        dataSource3Color:#ff0000|dataSource1Legend:|xAxisTitle:Inventory|
                        axisColor:#000000|labelColor:#000000|dataSetLabelIndex:1|"
	                    type="com.ibm.hats.transform.components.VisualTableComponent"
	                     componentSettings="minRows:1|validateCharacterType:false|
                        includePreviousLineAsHeader:true|columnBreaks:|minColumns:1|
                        behaveAsInDefaultRendering:false|areaAsInDefaultRendering:false|
                        overrideRecognitionBehavior:false|evaluateBetterTableParameter:numberOfCells|
                        excludeCols:|numberOfTitleRows:0|columnDelimiter: |
                        betterTableHasLeastOfParameter:false|includeEmptyRows:true|
                        excludeRows:1|" />
            </div>
            </td>
          </tr>
      </tbody>
  </table>

The following figures show this example TabContainer widget displayed at runtime. On the Table tab notice the data rendered using the HATS Dojo Enhanced grid widget.

Figure 18. Dojo Enhanced grid widget in Dojo TabContainer widget
Dojo Enhanced grid widget in Dojo TabContainer widget

On the Graph tab notice the data rendered using the HATS Graph (horizontal bar) widget.

Figure 19. Graph (horizontal bar) widget in Dojo TabContainer widget
Graph (horizontal bar) widget in Dojo TabContainer widget

Using the Dojo TabContainer widget in a HATS portlet project

You can use the Dojo TabContainer widget in a HATS portlet project.

Note:
HATS Dojo widgets are not supported in HATS portlets. When creating tabs using the Dojo TabContainer widget, use HATS non-Dojo widgets to render host components within the tabs.

To use the Dojo TabContainer widget in a HATS portlet project, follow the steps similar to using the widget in a HATS Web project, with the following considerations.

  1. The Use Dojo technology option is not available when creating a HATS portlet project. After a HATS portlet project is created, in the HATS Projects view right-click on the project, select Properties -> Project Facets. Expand the Web 2.0 project facet and select Dojo Toolkit on WebSphere® Portal 1.0. This makes Dojo widgets available for selection on the Palette view.
  2. When dragging the Dojo TabConatiner into the screen transformation, on the Specify a jsp file for Dojo bootstrap entries page, select Generate in the portlet jsp file, clear Generate portlet helper JavaScript classes in portlet application, and click OK.
  3. If dragging the Dojo TabContainer widget to the Design view does not cause the widget to be added to the source, a workaround is to drag the widget to the location after the <TD> tag in the Source view.
  4. The following TabContainer <div> tag is created.
    Note:
    The user interface for entering the number of tabs is not prompted and the ContentPane is not generated.
    <div dojoType="dijit.layout.TabContainer"
    		  id="tabContainer_<portletAPI:namespace/>"
           style="width: 500px; height: 100px"></div>
  5. To create tabs, drag ContentPane widgets (under Dojo Layout Widgets from the Palette view) to before the </div> tag, resulting in the following source:
    <div dojoType="dijit.layout.TabContainer"
    		  id="tabContainer_<portletAPI:namespace/>"
           style="width: 500px; height: 100px">
    <div dojoType="dijit.layout.ContentPane"
    					id="contentPane_<portletAPI:namespace/>"></div>
    <div dojoType="dijit.layout.ContentPane"
    					id="contentPane_<portletAPI:namespace/>"></div>
    <div dojoType="dijit.layout.ContentPane"
    					id="contentPane_<portletAPI:namespace/>"></div>
    </div>
  6. Add titles and insert a HATS component into each ContentPane widget.
    Note:
    You can see the layout in Design view, but nothing is displayed in the Preview view.
  7. Export the portlet and deploy it to a Portal server.
    Note:
    If necessary, you can adjust the height and width of the TabContainer widget to get the desired display. Note that you must use fixed height and width on the TabContainer widget in case the tabbed folder is not displayed at runtime.

Below is example source for a TabContainer widget, containing three tabs, rendering an IBM® i Main Menu screen. The tabs contain the HATS Selection list, Command line, and Function key host components, respectively.

<!-- Insert your HATS component tags here. -->

<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
   <!-- flm:table -->
   <tbody>
         <tr>
            <td>
            <div dojoType="dijit.layout.TabContainer"
	               id="tabContainer_<portletAPI:namespace/>"
                 style="width: 500px; height: 400px">
            <div dojoType="dijit.layout.ContentPane"
	               id="contentPane_<portletAPI:namespace/>" title="MenuOption">
                 <HATS:Component
                       row="5" erow="17" col="1" ecol="80" 
                       alternate="" alternateRenderingSet="" textReplacement=""
	                    widget="com.ibm.hats.transform.widgets.SLRadioButtonWidget"
	                    widgetSettings=""
					        type="com.ibm.hats.transform.components.SelectionListComponent"
					        componentSettings=""  />
            </div>
            <div dojoType="dijit.layout.ContentPane"
					     id="contentPane_<portletAPI:namespace/>" title="CommandLine">
                 <HATS:Component
					         row="19" erow="21" col="1" ecol="80" 
                       alternate="" alternateRenderingSet="" textReplacement=""
					         widget="com.ibm.hats.transform.widgets.InputWidget"
					         widgetSettings=""
					         type="com.ibm.hats.transform.components.CommandLineComponent"
					         componentSettings=""  />
            </div>
            <div dojoType="dijit.layout.ContentPane"
					     id="contentPane_<portletAPI:namespace/>" title="FunctionKey">
                 <HATS:Component
					           row="22" erow="23" col="1" ecol="80" 
                         alternate="" alternateRenderingSet="" textReplacement=""
					           widget="com.ibm.hats.transform.widgets.ButtonWidget"
					           widgetSettings=""
					           type="com.ibm.hats.transform.components.FunctionKeyComponent"
					           componentSettings=""  />
            </div>
            </div>
            </td>
        </tr>
   </tbody>
</table>