"How to" control Action Button

After click once, I need to modify action attribute of Create button in visible = “false”. How can I do that?

    <action id="create"
            visible="false" />
    <action id="edit"
    <action id="remove"/>


You can inject Create action and add a BeforeActionPerformedHandler, for instance:

private CreateAction productsTableCreate;

public void init(Map<String, Object> params) {
    productsTableCreate.setBeforeActionPerformedHandler(() -> {
        return true;


It works. Thank you.
The problem is after SAVE the button is visible again.

I tried with setEnable / isEnable but I have only two option: disable forever or enable forever.

Actually I want to perform Create action only once, after that the button should be disabled (invisible) forever.

Well, if you want to create a particular entity only once, then you can check the existence of such entity and enable the create action if no entity has been created.

Below the answer:

private CreateAction invoiceTableCreate;

private boolean hasNoInvoice()
    return getItem() == null || getItem().getInvoice() == null || getItem().getInvoice().size() == 0;

public void init(Map<String, Object> params) {

    boolean ok = hasNoInvoice();
    invoiceTableCreate.setVisible( ok );

invoiceTableCreate.setBeforeActionPerformedHandler(() -> {
boolean ok1 = hasNoInvoice();
invoiceTableCreate.setVisible( ok1 );
return ok1;

    //    super.init(params);



Dear Gleb,

Can you help me please with this topic: How to debug in Idea - CUBA.Platform

Unfortunately I don’t know how to debug in Idea…