Widget (attribute of action)
From JRapid
widget is an attribute of action.
Contents |
Description
The widget defines the way an action is rendered, on its location.
Take a look at the image to visually identify the different widgets.
Note: If widget is not defined, button is taken as the default value.
Available widgets are:
- button
- Renders the action as an HTML INPUT TYPE=button element, with the label as VALUE. (default)
- link
- Renders the action as an HTML A (anchor) element, with the label as child.
Both widgets use the ONCLICK attribute of its elements (div|a) to fire the action's event.
Usage
<action name = NAME label = LABEL type = TYPE widget = WIDGET ... />
Example
The code below was used to generate the entity in the image above.
<entity name="WikiActionWidget" label="Action Widgets" menu="wiki" >
<property name="name" label="Name" display="primary" />
<property name="company" label="Company" entity="Company" display="primary" />
<action name="action01" label="Action widget 'link'"
widget="link" location="listing"
type="javascript" function="testJavascriptAction" functionparams="'action 01'" />
<action name="newCountryCompany" label="Action widget 'button' (default)"
widget="button" location="listing"
type="relatedentity" entity="Company" defaultset="forCountry" />
</entity>

