JSTags: dual-combo tag

Description

It allows a combo being filled with data fetched asynchronously (ajax) from a given URL based on the value of another combo box.

The URL data is fetched from must return a String representing a JSONObject. In order to do this, you can make use of Json-lib. That is, the server response should be something like:

{
        p1: 'Name of the first product'
        p2: 'Name of the second product'
        p3: 'Name of the third product'
}

where pX will be the value used for every Option HTML element created in the targetFieldName select and, its value, the text that will be displayed for such an option.

Tag reference

Attribute name Description Default Required Valid values
url URL the data to fill the second combo will be retrieved from. true
sourceFormName Name of the form the first combo belongs to. true
sourceFieldName Name of the field in the first combo that will be used to fetch data from the given URL based on its value. true
targetFormName Name of the form the second combo belongs to. true
targetFieldName Name of the field in the second combo, the one that will be filled with the data fetched from the given URL. true
nameValuePairs a ',' separated object of pairs name:value. These parameters will be added, with the value given here, to the request. true a String representing a JavaScript-like object. i.e. {name1:'value1',name2:'56'}

Note: all of the attributes accept runtime expressions.