Reputation: 868
I'm working with Hybris 5.6 and I'm trying to add a button in the editor area right next to the save/reload/delete buttons.
How can I add a button to the ToolBarChip like in the example below?
Upvotes: 2
Views: 856
Reputation: 3759
It's quite possible to add a new action (label) to the toolbar of HMC, however it's not so recommended as it may result some issues while the migration.
<type name="AbstractOrder" mode="append">
<organizer mode="append" >
<editor>
<tab name="payment_and_delivery" position="2" mode="append">
<section name="deliveryadministration" mode="append" >
<table>
<tr>
<td width="16px">
</td>
<td>
<!-- here is the interesting part -->
<action type="item"
classname="com.foo.bar.MyNewAction"
name="action.my_new_action"
toolbaricon="my_new_action"
icon="images/icons/my_new_action_icon.gif"
autosave="true"
showtoolbarlabel="true"
hidebutton="true"
/>
</td>
</tr>
</table>
</section>
</tab>
</editor>
</organizer>
</type>
MyNewAction.java
that extends from ItemAction
and implement the method ActionResult perform(ActionEvent event)
:public MyNewAction extends ItemAction {
@Override
public ActionResult perform(ActionEvent actionEvent) throws JaloBusinessException {
//what the new action should do here ...
}
}
Note : you could override other interesting methods to be triggers while the action is possessing like : boolean needConfirmation()
or String getConfirmationMessage()
...
The result would be like this :
Upvotes: 3