Refreshing options of a SELECT element

Top  Previous  Next

The options of an HTML SELECT element can be refreshed with AjaxMgr.refreshOptions() method call as follows.

  AjaxMgr.refreshOptions({
    actionName        : 'RefreshOptionsAction1'
    ,optionNode       : 'NAME'
    ,valueNode        : 'ID'
    ,targetElement    : 'CITY_id'
    ,staticOptionsQty : 1
    ,requestParams    : {COUNTRY_ID:elm.value}
    ,busyImage        : 'BI1'
    ,callbackFunc     : SetInitialValue
    ,userData         : {userdata1:data1}
    ,errorHandler     : MyErrorHandler
  })

 

See AjaxMgr.refreshOptions() method call in MoreMotion Face API .

The value of the actionName property should point to an existing actionParams element in the page configuration as follows.

actionParams configuration for AjaxMgr.refreshOptions() call:

  <actionParams name="RefreshCities">
    <param name="dataSource">cities_of_country</param>
    <param name="valueNode">ID</param>
    <param name="encryptTheValue">true</param>
    <param name="responseHandler">AjaxMgr.refreshOptionsResponseHandler</param>
  </actionParams>  

Parameters of actionParams configuration element

dataSource (Accepts MScript)

The name of a dataSource configuration element that supposed to supply fresh data for the options of the SELECT element.

 

valueNode (Accepts MScript)

The name of the data node that will be used as the option value.

 

encryptTheValue (Accepts MScript)

Flag to indicate that the value of the data node specified with valueNode element to be encrypted.

 

responseHandler (Accepts MScript)

The name of the response handler Javascript function that will receive the AjaxMgr.refreshOptions() MultiPartAjaxResponse and manage the refreshing of the target SELECT Element. Unless a very special treatment is required the value of this element can be left to its default which is AjaxMgr.refreshOptionsResponseHandler.

 

Refreshing with RefreshOptionsProcess

Refreshing the options of a SELECT element can also be done using the RefreshOptionsProcess