Displayactions (attribute)

From JRapid

(Redirected from Displayactions)
Jump to: navigation, search

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

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

  • in listings, it is used to display only a subset of all the actions 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 actions that have location='form' will be shown (but it would be the same as not to put "form" between the action's location).
NOTE: if an action is included in the displayactions attribute, but it has no location 'form', it won't be shown.


Examples

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


    <entity name="WikiEntityDisplayActions" label="Display Actions (entity)" menu="wiki" 
    	displayactions="action01">
    
    	<property name="name" label="Name" display="primary" />
    	<property name="company" label="Company" entity="Company" display="primary" />
    	
       	<action name="action01" label="Action 01 (visible) "
            type="javascript" function="testJavascriptAction" 
 	    location="form, listing, local" />
       		
       	<action name="action02" label="Action 02 (invisible)"
            type="javascript" function="testJavascriptAction" 
            widget="button"
            location="form, listing, local"/>
       		
       	<action name="newCountryCompany" label="New Company (invisible)"  
            type="relatedentity" entity="Company" defaultset="forCountry"
            widget="link" 
            location="form, listing, local"/>
       		
       	<!--  this listing's purpose is to make all the actions visible -->	
        <listing name="showAll" />	
    </entity>

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

File:Entity_Displayactions.png

Here we can observe that only "ACTION 01" is rendered, and the other two are dismissed. Note that the same "hiding" applies to locations "local" and "listing".


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

File:Entity_Displayactions_(negative).png

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

Pay attention here to the widgets being rendered. Action 01 has no widget, and, depending on the location, it is rendered using:

  • "link" (default for location local)
  • "button" (default for location listing)

The other two actions define they own widgets, which are respected.

Personal tools