Displayactiongroups (attribute)

From JRapid

Jump to: navigation, search

"displayactiongroups" is an attribute than can be applied to:

In both cases it behaves in a similar way: it is always used to choose which actiongroups to show (and which ones not).

  • in listings, it is used to display only a subset of all the actiongroups with @location = 'local' or 'listing'.
  • in entities, its main purpose is to be used as if it was about the default/implicit listing.
but also, it may be used to tell which of the actiongroups that have location='form' will be shown (but it would be the same as not to put "form" between the actiongroup's location).
NOTE: if an actiongroup is included in the displayactiongroups attribute, but it has no location 'form', it won't be shown.


The code below was used to generate the following two images:

    <entity name="WikiEntityDisplayActiongroups" label="Display Actiongroups (entity)" menu="wiki" 
        <property name="name" label="Name" display="primary" />
        <property name="company" label="Company" entity="Company" display="primary" />

        <actiongroup name="group01" location="form, local, listing" label="I am group 1" widget="div">
            <action name="action01" label="Action 01" type="javascript" function="testJavascriptAction" />
            <action name="action02" label="Action 02" type="javascript" function="testJavascriptAction" />
        <actiongroup name="group02" location="form, local, listing" label="I am group 2, shouldn't be seen">
            <action name="newCountryCompany" label="New Country company" 
                type="relatedentity" entity="Company" defaultset="forCountry" />
            <action name="mainReplacement" label="Open entity (link)"
                type="openentity" widget="link" />

        <!--  this listing's purpose is to make all the actiongroups visible -->	
        <listing name="showAll" />		

In the first case, we show how this AML code generates the default listing (implicit) for this entity:


Here we can observe that only "GROUP 01" is rendered, and GROUP 02 is dismissed. Note that the same "hiding" applies to locations "local" and "listing".

The same happens if the entity's form:


On the contrary, if we open the "showAll" listing, this is what we get:


In this case, as this listing does not specify any "displayactiongroups", all the actiongroups with location "listing"/"local" will be rendered.

Pay attention here to the widgets being rendered: Group 01 has widget=div, but Group 02 has no widget and it is rendered using the "select" widget, which is the default.

Personal tools