Functionparams (attribute of action)

From JRapid

(Redirected from FunctionParams)
Jump to: navigation, search

functionparams is an attribute of action.


Contents

Description

The functionparams attribute specifies the extra parameters an action of javascript type can receive. This attribute can be used only when the location is "local".

Usage

<action
   name = NAME
   type = "javascript"
   function = FUNCTION
   functionparams = SEMMICOLON_SEPARATED_PARAMS
   ...
/>

If the JavaScript function we are calling receives two extra parameters it must be declared as follows:

 function name(obj, ids, param1, param2) {
    ...
 }

Example

  • showSelectedPersonInfo Action:
function showSelectedPersonInfo(obj, ids, firstName, lastName) {
    alert(firstName + " " + lastName + " id: " + ids[0]);
}
<entity name="Person" label="Person">
     <property name="firstName" label="First name" display="secondary" />
     <property name="lastName" label="Last name" display="primary" />
     <action name="showSelected" location="local" type="javascript"
            function="showSelectedPersonInfo" functionparams="firstName;lastName"/>
</entity>

See also

Personal tools