Location (attribute of actiongroup)

From JRapid

Jump to: navigation, search

location is an attribute of actiongroup.

Contents

Description

The location attribute specifies where to render the actiongroup.

The possible values are:

  • "form": the actiongroup will be rendered on the bottom of the entity's form.
(if not hidden by displayactiongroups).
  • "listing": the actiongroup will be rendered on the bottom of each entity's listing
(if not hidden by displayactiongroups).
  • "local": the actiongroup will be rendered somewhere in the row of the entity listing (depending on the view).
(if not hidden by displayactiongroups).


NOTE: some views may not support the "local" location, in that case, the actiongroup won't be visible.

Usage

<actiongroup name = NAME 
   label = LABEL 
   location = "listing | local | form" >
   (actions)
</actiongroup>

Example

Take a look at the image below. Here we can see several things:

  • the top-part of the image is the default listing of the entity
    • here we see both the locations LISTING and LOCAL of the same action with label='Widget Select (default)'.
    • if you look at the code, you'll see that the actiongroup has no widget defined.
  • the bottom-part of the image is the entity's form
    • right next to the OK and CANCEL buttons, you'll find the same actiongroup as in the listings
    • the form has 2 properties, and the 2nd one has a property-actiongroup associated to it
    • if you click on "action 03" or "action 04", you'll get the alert, that simply outputs the text of the select option of the property.

File:Actiongroup_locations.png


    <entity name="WikiActiongroupLocation" label="Actiongroup Locations" menu="wiki" >
       	<property name="name" label="Name" display="primary" />
    	<property name="company" label="Company" entity="Company" display="primary" >
            <actiongroup name="actionGroupDiv" label="Widget Div"   
                widget="div" >
                <action name="item03"  label="action 03"
                    type="javascript" function="testJavascriptPropertyAction" />
                <action name="item04"  label="action 04"
                    type="javascript" function="testJavascriptPropertyAction"  />
            </actiongroup>	
        </property>
        <actiongroup name="actiongroupSelect" label="Widget Select (default)"   
            widget="select" location="listing, form, local"  >
            <action name="action01" label="action 01"
                type="javascript" function="testJavascriptAction" functionparams="'action 01'" />
            <action name="item02" label="action 02"
                type="javascript" function="testJavascriptAction" functionparams="'action 02'" />
            <action name="newCountryCompany" label="New Country company" 
                type="relatedentity" entity="Company" defaultset="forCountry" />
        </actiongroup>   
    </entity>

See also

Personal tools