Refresh Button in Cuba 7

Hi,

Unfortunately refresh button in Cuba 7 doesn’t work.

Usually I use:

 <actions>
                <action id="create" type="create"/>
                <action id="edit" type="edit"/>
                <action id="remove" type="remove"/>
                <action id="refresh" type="refresh"/>
            </actions>

 <buttonsPanel id="buttonsPanel"
                          alwaysVisible="true">
                <button id="createBtn" action="organizationsTable.create"/>
                <button id="editBtn" action="organizationsTable.edit"/>
                <button id="removeBtn" action="organizationsTable.remove"/>
                <button id="refreshBtn" action="organizationsTable.refresh"/>
 </buttonsPanel>

In Cuba 6 works fine.

Also I tried in the controller:

  @Subscribe("refreshBtn")
    private void onRefreshBtnClick(Button.ClickEvent event) {
                organizationsDl.load();
    }

but still doesn’t work.
Can you give me a solution pls?

My goal is: after a specific Search to refresh(reload) all records.

Hi,
I have just checked the refresh button on a CUBA 7.0.10 and it works as expected.

If you still need help then please:

  1. explain in more detail what you were trying to achieve (what is a “specific Search”?)
  2. provide a minimal use case how to reproduce the problem

Hi,

see here:

If you want Refresh button to act exactly like Filter’s Search button does -
then you can inject Filter component to screen controller and call its method:
com.haulmont.cuba.gui.components.Filter#apply

Ok. But why in Cuba 6 it works?
Nevertheless can you give me some example to Refresh usage?

Because the behavior has changed. There is nothing super-surprising in the fact that behavior of some CUBA components changes between major versions.

Ok, then can you give me a specific example in order to implement Refresh button in Cuba 7, pls?

  1. Subscribe to button click
  2. Inject filter component
  3. Call Filter#apply(options)
1 Like