How to set value for additional properties in action element?

Hi,

Currently , we can define some “standard” properties for action in screen xml,like ‘type’,‘id’,‘icon’ ect.

In a custom Action, it has some additional properties besides standard properties.

How to set the value for the additional properties in action element?

Hi,

You cannot set additional properties for actions in XML. You can injected them to a screen controller and call API of an action there.

Hi,

Thanks for your reply.

Also i have inspected the source code, found that it’s impossible for set additional properties for action currently.

That’s not a problem.In fact,it’s an idea from a developer in CUBA Chinese Forum,he want make a ‘common’ Action for table that can move up/down row.

I think that If we can set additional properties for Action like Spring Bean define in xml:

<bean name=="name">
    <property name="x" value="xValue" >
    <property name="y" value="yValue" >
</bean>.

Action declaration may be like :

<action id="rowmove1" type="rowMoveDownAction" caption="MoveDown">
       <property name="sortField" value="sn" >
</action>

That will be great help for make “common” action.

Or could you give a suggestion for make “common” Action?

Regards

I’d recommend not to introduce actions with a lot of options, but instead - extract functionality to Spring beans, so they can be invoked from any place, not only as actions.

We will think about properties approach, but there are no concrete plans yet.

Hi,

Thanks for your reply.

Finally, we found a approach to set additional properites for a Action,thanks to CUBA’s extendibilityl
We extend the LayoutLoaderConfig bean builtin CUBA Platform,and override the loadLoaderConfig method,
in there, we add a customized Loader to replace default Loader.

If the platform can “native support” additional properties,it will be great help.

Regards.