Contents: Creating mashups : Mashup Center 2.0
The User Input
widget provides a way for you to create a simple form with various input controls quickly and easily. You can use the following types of input controls in your form:
- one-line text input field
- numeric input field
- check box
- list box (drop-down)
- calendar date picker
- multiple-line text area
- radio button (three allowed in a single line)
Each field can have a default value. Users can submit information directly through the widget's user interface. When you wire the User Input
widget to other widgets, the user-submitted information to is sent to these widgets when the user clicks the Submit
When configuring the User Input
widget, use the following tips:
- To add a new input control, click Add. This creates a new entry in the configuration window in which you can provide a name, select the input control type, create a caption, and provide values. Each input control type has its own set of options that you can configure.
- After you add more than one input control, you can select them and click Up and Down to move them down or up on the form.
See the following table to learn which events the User Input
widget can send and receive:
Table 1. User Input events
|Data Object as JSON: sends a JSON object with name/value pairs of all input fields.||This widget does not receive any data. |
|Data List as Any Data: sends an array with a JSON object that contains name/value pairs of all input fields. Use this option when wiring with the Data Viewer widget. As a result, a horizontal table with field names being represented as column names will display.|
|Name Value Pairs as Any Data: sends an array of JSON objects for each input field name/value pair. Use this option when wiring with the Data Viewer widget. As a result, a vertical table with input fields being represented by separate rows will display.|
By default, the wiring dialog box also provides options for sending events for each field that you have added to the form.
: Create a simple form with a one-line text input field and display submitted data in the Event Explorer
- Drag the User Input and Event Explorer widgets onto the mashup page.
- Hover your cursor over the User Input widget, click the menu options icon , and click Edit Settings to open the configuration window.
- Click Add.
- In the Name column, replace New field with Your name: .
- In the Type field, select text.
- Click Save. Now your new text field displays in the widget window.
- Hover your cursor over the User Input widget, and click the wiring icon to open the wiring interface.
- Click the Send tab.
- In the Select content to send section, select Your name: as Text.
- In the Select a widget to receive content section, select Event Explorer.
- In the Select an action section, select Event data using Any Data.
- Click Done to close the wiring dialog box.
- In the User Input widget window, type your name in the Your name field.
- Click Submit. Your name should now display in the Event Explorer widget window.
Parent topic: Widget reference : Mashup Center 2.0