Mainaction (attribute of entity)

From JRapid

Jump to: navigation, search

"mainaction" is an attribute of entity.

When set, it overrides the default 'main' action of the default listing (uses view=table, see listing's mainaction).

So, if, for example, you want that your listing alerts the row id when someone double-clicks on it, you should use:

<entity name="WikiMainActionEntity" label="Wiki Main Action Entity" menu="wiki"
    <property name="firstName" label="First Name" display="primary" />
    <property name="lastName" label="Last Name" display="primary"/>
    <action name="sampleAction" label="(label is invisible when action is 'mainaction')"
        type="javascript" function="alertRowId" />	

NOTE: For this to work, you will have to define the "alertRowId" javascript function in your /webapp/Main/js/Main.js (or any other set by you):

function alertRowId( srcElem, ids ){
	alert( ids );

And when you fire the "main" action, instead of opening the entity's row, you'll get:

[insert screenshot here]

Personal tools