Own action menu Entry

  Written by The Jahia Team
 
Developers
  gwt
   Estimated reading time:
7.2.1.0
Is it possible to have an own GWT action menu entry?

Answer

It is possible to reuse the org.jahia.ajax.gwt.client.widget.toolbar.action.ExecuteActionItem where you can define a specific action which will be called when you select this action item like:

<bean id="Toolbar.Item.yourAction" class="org.jahia.services.uicomponents.bean.toolbar.Item" scope="prototype">
    <property name="actionItem">
        <bean class="org.jahia.ajax.gwt.client.widget.toolbar.action.ExecuteActionItem">
            <property name="action" value="yourAction"/>
        </bean>
    </property>
    <property name="titleKey" value="Your Action title"/>
    <property name="icon" value="upload"/>
    <!-- any other icon can be reused -->
</bean>

You have to declare the Action yourAction as you can see from the property action (you could define this action in a module):

<bean class="your.module.modules.actions.YourAction"/>

(we do a mapping between the class name and the action, YourAction will be called with node.path.your.do)