Variable Input Control Builder

 

 

In this topic ...

Quick Tips

Specifying Inputs

Specifying Extra Data

Use this Builder when you create variable forms where the text, layout, and styles of the controls are stored in a database or in files. For example, create a page with a <TABLE> tag and a single <TR> tag. Then attach a Repeated Region or a Dynamic Table Builder to these locations to repeat the <TR> tag for every element in your data. The data can contain your prompts and your values for the Variable Input Control Builder. The control tag for the Variable Input Control Builder would be placed inside a column inside the repeated section.

At run time, this Builder evaluates the text referenced as the Input Type field and directs subsequent processing to the appropriate input tool. Because of the way this control works, make sure that text used to describe the Input Type correctly evaluates to one of the following:  TextArea, TextInput, HiddenInput, Select, RadioBox, or CheckBox. If the Input Type value does not evaluate correctly, the entire input control will not be shown.

 

Quick Tip

  • Builder Replaces Tag - When this Builder is applied in "On Named Tag" or "Relative to Named Tag" modes, it replaces the control tag completely, and no further modifications to the tag can be done, and no additional Builders can be applied to the tag. If you attempt to use the tag an error message about the missing tag indicates that nothing further can be done with this tag.

  • Value Field Behavior - If you specify a value in the Value field, the corresponding Text Key is displayed in the Select, RadioBox, or Checkbox List Builder.

 

Specifying Inputs

The Variable Input Control Builder takes the inputs described in the table below. For help on inputs common to many or all Builders such as those in the Properties and HTML Attributes input groups, see "Using the Builder Call Editor."

Input Name Description
Name Enter a name for this Builder call. The Designer displays this name in the Builder Call List.
Page Location Use the Page Location input to specify the page or pages on which this Builder call will act.

See "Locating Control Builders on Pages" for detailed documentation about the Page Location input and page location syntax.

This Builder Replaces Tag - When this Builder uses the "On Named Tag" or "Relative to Named Tag" location technique, the Builder replaces the control tag completely. No further modifications or Builders can be applied to this tag. For example, an attribute setter applied to this tag will not have any effect.

Input Type This text determines the type of input control placed on the screen. In most cases, you enter an indirect reference for this field, obtaining the data from a variable, service result, or even the loop variable from a Repeated Region or Dynamic Table Builder.

The only circumstances under which you would enter a static value in this field would be if you plan to profile the value and change it for different profiles.

Note: This choice must evaluate to one of the following strings: TextArea, TextInput, HiddenInput, Select, RadioBox, or CheckBox.

Default Value Enter the value that the input control should display when it is first rendered for display. We can enter an indirect reference.

If the input control is a text type, the value displayed is for the user to edit. If the Input Control is a list of choices (Select or a Radio Box), this value represents the choice that is selected upon initial display.

Extra Data Select an indirect reference, such as a variable or service input, to a source of content for the input control.

This source must provide a comma-delimited list of choices or an XML structure. To learn which types of inputs we can use with the input controls, see Specifying Extra Data.

(Optional) HTML Name Attribute If you are planning to put the control tag for the Variable Input Control Builder in a repeated region, you have to enter a name for the input control.

In most cases enter a subnode of the loop variable or something using the count variable to make a unique name for the inputs you would be generating.  

 

Specifying Extra Data

The Extra Data field determines the content displayed by the input control. Each of the different choices for the "Input Type" has a different meaning for the "Extra Data" field. The table below shows how the field is interpreted. The Example column provides examples of the value for the input type. Very likely you will want to use an indirect reference to extract this value from a variable, loop variable, etc.

Input Type Meaning of "Extra Data" Example
TextInput width

Sometimes the length of the text determines the width of the text input.

60
HiddenInput: Extra data ignored  
Textarea "rows, columns" for display size and "wrap" to specify text-wrapping or not 15,60,true
RadioBox: Choices (See Working with Choices below) Choice-1, choice-2, choice-3
Select: Choices  (See  Working with Choices below) , ,Ford, Chevy, BMW, Kia
Checkbox: "checkedValue, uncheckedValue, prompt" yes, no, Use Optimizer?

 

Working with Choices

*There are three input types in this table that support "Choices." All three types can accept a string or an XML structure for the value. When the value evaluates to a string, the string is treated as a comma-delimited list. In this case, we can start the string with two commas (see the examples above) to indicate a blank first choice.

When the value evaluates to a list of choices, the list must be an XML structure. Such a list might be stored in a variable or be supplied by a service output. Regardless of its source, the XML structure should have the following format:

<theList>

  <choice>First choice</choice>

  <choice>Second choice</choice>

</theList>

If you want your choices to have a different display value from their actual value,we can include them separately in each choice. Unlike the more specific builders (Select, Radio Box, and Selectable Input), you do not have the opportunity to specify the tag name for the Text Key and Value Key. We can specify the value by adding a "value" attribute to each choice element. For example:

<theList>
<choice value="first">First choice</choice>
<choice value="second">Second choice</choice>
</theList>