8.2.1  Creating a Slider or Spinner

To create a Spinner, follow the steps below. (The Slider is identical.)

1. Drag the 'Spinner' element from the component tree into the Viewsheet grid. This creates an empty Spinner in the Viewsheet grid.

 

2. Right-click on the Spinner, and select 'Properties' from the context menu. This opens the 'Spinner Properties' dialog box.

3. Under the General tab, specify the 'Minimum' and 'Maximum' values.

4. If you will use the Spinner to control dynamic properties of another element, follow these steps:

a. Enter a 'Name' for the control. This is the name by which the control is identified in dynamic property menus. (See Dynamic Properties.)

b. Click 'OK' to finish.

Note: If you plan to use the Slider or Spinner to set dynamic properties, you do not need to specify an Embedded Table or Variable in the Data tab.

5. If you will use the Spinner to control values in a Worksheet Embedded Table or Variable, follow the steps below:

a. Select the Data tab.

b. In the 'Target' list, expand the 'Tables' or 'Variables' node, and select an Embedded Table or Variable from the linked Worksheet.

The format shown is “row: value.” The left number is the row index, the right num­ber is the current value in that row (i.e., the default value).

c. For an Embedded Table, select the desired column from the 'Column' list and the desired row from the 'Row' list. The row and column together define the cell to which the Spinner provides data.

d. Click 'OK'.

 

Example: Spinner Control of Embedded Table  >>

In this example, you will use a Spinner control to display only values in a table that exceed the specified Spinner value.

1. Create a new Worksheet.

2. In the following steps, add a new Embedded Table containing a single numeric data cell:

a. Click the 'New Object' button on the toolbar, and select 'Embedded Table'.

b. Drag across the Worksheet grid to select three vertical cells, and release.

 

This creates a new Embedded Table named 'Query1', with just one data cell.

c. Double-click the column header cell ('col0'), and change the name to “Quantity”.

d. In the data cell of the Embedded Table, enter the value “4000.”

e. Right-click the column header cell ('Quantity'), and select 'Column Type' from the context menu.

 

This opens the 'Column Type' dialog box.

f. In the 'Column Type' dialog box, set 'Type' to 'Integer'. Click 'OK'.

3. Expand the 'Orders' data source on the Asset tree, and drag the 'Sales by Category' query onto the Worksheet. This creates a new table called 'Sales by Category1'.

Note that a Range Slider provides a very simple way to filter based on value, with­out requiring Embed­ded Tables.

4. In the following steps, join the Embedded Table to the 'Sales by Category1' table. The tables will be joined on the 'Qty Sold' column using an inequality join condition:

a. Select both of the tables (Shift-click).

b. Click the 'Join Table' button on the toolbar, and select 'Inner Join'. This opens the 'Inner Join' dialog box.

c. On the left side, select 'Query1.Quantity' from the top menu.

d. On the right side, select 'Sales by Category1.Qty Sold' form the top menu.

e. From the center menu (comparison operator), select '<=', as shown below.

 

f. Press 'OK'.

The tables are now joined on the 'Qty Sold' column, creating a new table called 'Query2'. The values shown in the 'Qty Sold' column of joined table 'Query2' will only be those which equal or exceed the 'Quantity' value in the Embedded Table.

5. Verify that the joined table is filtered correctly:

a. Press the 'Change View' button in the toolbar of the 'Query2' table and select 'Live Preview'. Expand the table to show all the data. (Only values of 'Qty Sold' greater than or equal to 4000 are shown.)

b. Enter “6000” as the value in the Embedded Table, and observe how the data in table 'Query2' is filtered accordingly.

 

6. Prepare the joined table to be displayed in a Viewsheet:

a. Right-click the 'Query2' table title bar and select 'Properties' from the context menu. Change the name of the joined table to “Result Table”.

b. Press the 'Change View' button in the toolbar, and select 'Default' to exit live-data mode.

c. In the left-most table column named 'Quantity', click the 'Visibility' button to hide the column. (This column shows the value from the Embedded Table, and does not need to be displayed in the Viewsheet.)

 

d. Save the Worksheet as “Large Quantity”.

7. In the following steps, create a new Viewsheet to display the 'Result Table' from the Worksheet:

a. Create a new Viewsheet based on the 'Large Quantity' Worksheet.

b. From the Component tree, drag the 'Result Table' Data Block onto the Viewsheet grid. This creates a table called 'Result Table'.

c. Drag the table handles to make the table taller, so that about 10 rows are shown.

 

8. Add a Spinner element to control the value in the Embedded Table (thus filtering the displayed 'Result Table'):

a. Drag a Spinner from the Component tree onto the Viewsheet grid.

b. Right-click the Spinner, and select 'Properties' from the context menu. This opens the 'Spinner Properties' dialog box.

The 'Row' menu shows a single row because the Embed­ded Table has only one row. The value shown is the current value of the Embed­ded Table cell, which was specified earlier.

c. Select the Data tab. In the 'Target' menu, expand the 'Table' node, and select 'Query1'. (This is the ID of the Embedded Table in the Worksheet.)

 

d. Select the General tab. In the 'Number Range' panel, set 'Maximum' to “10000.”

e. Press 'OK'.

9. Test the Spinner control by entering different values. Observe how the values in the table change: The table only displays records for which 'Qty Sold' is greater than the value you choose in the Spinner.

 

 

See Also

Using Input Components, for details on the Embedded Table interface.

Creating a New Data Worksheet, in Data Mashup.

Creating a New Embedded Table, in Data Mashup.

Dynamic Properties, to control properties with input elements.

<< 8.2 Slider and Spinner © 1996-2013 InetSoft Technology Corporation (v11.5) 8.2.2 Slider and Spinner Properties >>