neutrino36
(neutrino neutrino)
April 10, 2019, 2:23pm
#1
Is there any possibility to add a new Refresh button (in addition to OK and Cancel) for windowActions?
The idea is to refresh all data belong to a window.
I know that is possible related to a table but in my case there is no table.
Basically I need to refresh price value related to Start date and End date.
krivopustov
(Konstantin Krivopustov)
April 12, 2019, 2:17pm
#2
Add a button:
<hbox id="editActions"
spacing="true">
<button action="windowCommitAndClose"/>
<button action="windowClose"/>
<button id="discardBtn" caption="Discard"/>
</hbox>
Subscribe to the click event and reload the entity:
@Inject
private InstanceLoader<Customer> customerDl;
@Subscribe("discardBtn")
private void onDiscardBtnClick(Button.ClickEvent event) {
customerDl.load();
}
1 Like
neutrino36
(neutrino neutrino)
April 15, 2019, 8:31am
#3
Where should I declare component (instance) loader?
import com.haulmont.cuba.gui.model.InstanceLoader;
import com.haulmont.cuba.gui.screen.Subscribe;
I’ve tried under <datasource… but doesn’t work.
krivopustov
(Konstantin Krivopustov)
April 15, 2019, 3:00pm
#4
neutrino36
(neutrino neutrino)
April 16, 2019, 12:45pm
#5
Yes I saw but unfortunately doesn’t work (stays in red).
Could you give me an example, please?
krivopustov
(Konstantin Krivopustov)
April 18, 2019, 12:39pm
#6
Look at quick start .
You can also just create a browser or editor screen for an entity with Studio and see how it is defined.