Portlet Factory, Version 6.1.2


 

Checkbox Group builder inputs

This topic describes the inputs for the Checkbox Group builder inputs.

 

General inputs

Table 1. General inputs
Input name Description
Name Name for this builder call. The WebSphere Portlet Factory Designer displays this name in the builder call list.
Page Location Page or pages on which this builder call acts.
Checkbox List Data Specify the data for the checkbox group in one of the following ways:

Comma-delimited list

For example, assume you want to display four checkboxes, called spring, summer, fall, and winter. You would enter the following in the Checkbox List Data input.

spring,summer,fall,winter

Indirect reference to a variable of type XMLData

Enter an indirect reference to a variable, for example, ${Variables/ListData}. In the variable of type XMLData, enter an XML structure. Include the name you want for the checkbox and its value, as shown below.
<options>
  <option>
      <color>blue</color>
      <colorvalue>a</colorvalue>
  </option>
  <option>
    <color>yellow</color>
    <colorvalue>b</colorvalue>
  </option>
  <option>
    <color>green</color>
    <colorvalue>c</colorvalue>
  </option>
</options>

Java collection

Specify a method or Java expression that returns an object that implements java.util.Collection or an Iterator for a Java collection.

 

XML data source elements

Table 2. XML data source elements inputs
Input name Description
Value Element If you entered a value of type XMLData for the Checkbox List Data input, enter the name of the element corresponding to the value you want used.

For example, assume you entered the XML data shown in the example above and you want the value of the <colorvalue> element to be used as the value. You would enter colorvalue in the Value Element input. Important: Ensure that the element name matches the case of the element entered in the variable.

Use the Value Element input to specify which value in a multiple-valued source should be assigned to the value attribute of the <OPTION> tags in the list produced at run time.

Label Element If you entered a value of type XMLData for the Checkbox List Data input, enter the name of the element corresponding to the value you want to be used as the checkbox label.

For example, assume you entered the XML data shown in the example above and you want the value of the <color> element to appear as checkbox labels. You would enter color in the Label Element input. Important: Ensure that the element name matches the case of the element entered in the variable.

Use the Label Element input to specify which value in a multiple-valued source should become the text or visible label of an item in a selected list.

Selected Values

Determine the checkboxes you want to appear selected when the page is first loaded. Do one of the following depending on your configuration:

A comma-delimited list is the checkbox list data

Enter a value directly in the Selected Values input. If you want more than one checkbox to appear selected, use a comma to separate each entry, as shown below:

summer,fall

An indirect value is in the Checkbox List Data field, "Return Selected Values Only" is the return data format, and you want to enter the selected value directly.

Enter the value to appear selected when the page is loaded. To have more than one option appear selected, use a comma to separate each entry, as shown below:

a,b

where a and b are the values for the checkboxes to appear selected when the page is loaded

An indirect value is in the Checkbox List Data field, "Return Selected Values Only" is the return data format, and you want the selected value to be an indirect value.

Enter a reference to an indirect value, containing the checkboxes. For example, ${Variables/selectedvalues}. In the variable, enter the values to appear selected. For example, assume you used the XML example shown below, and you want to have the options blue and green selected when the page is first loaded.
<options>
 <option>
     <color>blue</color>
     <colorvalue>a</colorvalue>
  </option>
  <option>
      <color>yellow</color>
      <colorvalue>b</colorvalue>
  </option>
  <option>
      <color>green</color>
      <colorvalue>c</colorvalue>
  </option>
</options>

In the variable for the selected value, enter the <blue> and <green> elements within the <list> tag. Then assign these elements the same values as listed in the variable referenced in the Checkbox List Data input, as shown below:

<list>
   <blue>a</blue>
   <green>c</green>
</list>

The indirect value is in the Checkbox List Data field, "Return State of All Values" is the return data format, and you want the selected value to be an indirect value.

Enter a reference to an indirect value. The variable would contain the elements corresponding to their value. For example, if you entered the following in a variable for the checkbox list data:
<options>
  <option>
      <color>blue</color>
      <colorvalue>a</colorvalue>
  </option>
  <option>
      <color>yellow</color>
      <colorvalue>b</colorvalue>
  </option>
  <option>
      <color>green</color>
      <colorvalue>c</colorvalue>
  </option>
</options>

You would then list all of the options' values in an indirect variable for the selected values. In the Selected Values input, you would enter a reference for this variable. For example: ${Variables/selectedvalues}. Notice in the example below that the element names correspond to the values listed in the variable for the checkbox list data. For example, the <a> element in the example below corresponds to the <colorvalue>a</colorvalue> tag in the example above.

<list>
  <a>1</a>
  <b>2</b>
  <c>3</c>
</list>

In the Checked Value input, enter the corresponding value for the checkbox you want to appear set. For example, if you want the blue option to appear selected when the page loads, enter 1 in Checked Value. You would enter 1 because that is assigned to the a element, which in turn is the value for the blue option in the variable referred to in Checkbox List Data.

Return Data Format Specify one of the following for determining whether the input for the check box group is the state of all values or just the values for the selected check box options:

Return Selected Values Only

The input values for the check box just contain the values for the selected check box options.

Return State of All Values

The input values for the check box contain the values for all the check box options. This selection is useful when you want to determine the boolean value for each item in a list of options. This selection does not apply to check box source data that is in the form of name/value pairs.
Orientation Specify one of the following for the orientation of the drop-down menu:

Vertical

Select this option if you want the checkboxes to appear in a top-to-bottom list.

Horizontal

Select this option if you want the checkboxes to appear in a side-to-side list.

 

Advanced

Table 3. Advanced inputs
Input name Description
Checked Value (Return State of All Values) If you entered an indirect reference for the Checkbox List Data input and you selected Return State of All Values as a return data format, enter the value corresponding to the option you want to appear selected. For example, assume you entered the following for the variable for the selected value:
<list>
  <a>1</a>
  <b>2</b>
  <c>3</c>
</list>

And, these selected values correspond to the following checkbox list data:

<options>
  <option>
      <color>blue</color>
      <colorvalue>a</colorvalue>
  </option>
  <option>
      <color>yellow</color>
      <colorvalue>b</colorvalue>
  </option>
  <option>
      <color>green</color>
      <colorvalue>c</colorvalue>
  </option>
</options>

If you wanted the blue option to appear selected when the page is first loaded, you would enter 1 in the Checked Value input. You would enter 1 because that is assigned to the a element, which in turn is the value for the blue option in the variable for the checkbox list data.

Unchecked Value (Return State of All Values) (Default is false.) Specify the value for the checkbox when it is clear. This can be any text value that you want passed when the form containing this check box is submitted.

Parent topic: Checkbox Group builder


Library | Support |