Remove text from button that contains has an action defined

This is the source code that supports my question. In this state, my buttons have text on them, even though I did not added any caption property on them. How can I remove the default provided text?

PS: I noticed that on buttons that don’t have the action property set up, no text appears if the caption property is blank.

<table id="productsTable"
       width="100%">
    <actions>
        <action id="create"/>
        <action id="edit"/>
        <action id="remove"/>
    </actions>
    <columns>
        <column id="name"/>
        <column id="businessId"/>
        <column id="owner.accessGroup.name"
                caption="msg://owningGroup"/>
        <column id="owner.user.name"
                caption="msg://owningUser"/>
        <column id="type"
                caption="msg://type"/>
    </columns>
    <rows datasource="productsDs"/>
    <rowsCount/>
    <buttonsPanel id="buttonsPanel"
                  alwaysVisible="true">
        <button id="createBtn"
                action="productsTable.create"
                description="Create"
                icon="icons/create.png"/>
        <button id="editBtn"
                action="productsTable.edit"
                description="Edit"
                icon="icons/edit.png"/>
        <button id="removeBtn"
                action="productsTable.remove"
                description="Remove"
                icon="icons/remove.png"/>
    </buttonsPanel>
</table>

Hi, @bujoralexandru1996

To remove a caption you should inject your button into screen controller, override ready() method and set null value as caption of the button:

@Inject
private Button createBtn;

@Override
public void ready() {
    createBtn.setCaption(null);
}

Regards,
Daniil.

3 Likes

Thank you for your response!