Actiongroup (element)

From JRapid

Jump to: navigation, search

actiongroup is an element that can be

with similar behavior.


Contents

Description

Actiongroups are simply sets of actions grouped together with a name and a label (optional).

Each actiongroup can define a widget and location/s.

For the 'div' widget, if the labelposition attribute is present, the label is rendered as a fieldset.


Actiongroup Widgets

Take a look at the image to visually identify the different widgets.

Note: If widget is not defined, select is taken as the default value.


Available widgets are:

select
Renders the actiongroup as an HTML select element, whose options are the children actions.
div
Renders the actiongroup as an HTML div element, holding the children actions inside (uses the action's widget if any, otherwise, the actiongroup widget).


Actiongroups Locations

Available locations for actiongroups. (Visit the locations page for details and examples)

form
Appears in the bottom of the form, right next to the SAVE and CANCEL buttons.
listing
Appears in the bottom of the listing, right next to the ADD and REMOVE buttons.
local
Appears, in supported listing views (table, basic, thumbnails), as the local action, that is, a row level action.




Usage

<actiongroup
        name = NAME
        label = LABEL 
        location = "form" | "listing" | "local"
        widget = "select" | "div" 
/>


Examples

  • Actiongroup as child of entity with locations listing and form, and two children actions.
    <entity name="Company" label="Company">
        <property name="logo" label="Logo" type="image" width="120"/>
        <property name="name" label="Name" display="primary" required="required"/>
        <property name="active" label="Active" display="secondary" type="boolean"/>

        <actiongroup name="moreActions" label="More Actions" 
            widget="select" location="form, listing">
            <action name="newSaleAction" label="Create Sale" 
                type="relatedentity" entity="Sale" defaultset="forCompanyDef" />
            <action name="newEmployeeAction" label="Create Employee" 
                type="relatedentity" entity="Employee" defaultset="forCompanyDef" />
        </actiongroup>
    </entity>

    <entity name="Sale" label="Sale">
        <defaultset name="forCompanyDef">
            <param entity="Company" name="companyParam"/>
            <default name="company" value="companyParam"/>
        </defaultset>
        <property name="company" label="Company" entity="Company" display="primary"/>
        <property name="description" label="Description" type="text" />
        <property name="amount" label="Amount" display="primary"/>
    </entity>

    <entity name="Employee" label="Employee">
        <defaultset name="forCompanyDef">
            <param entity="Company" name="companyParam"/>
            <default name="company" value="companyParam"/>
        </defaultset>
        <property name="firstName" label="First Name" display="primary" />
        <property name="lastName" label="Last Name" display="primary" />
        <property name="company" label="Company" entity="Company" display="primary"/>
    </entity>


See also

Personal tools