Hi,
I have a screen with a datagrid and buttons to navigate to next and previous screens.When I edit the datagrid and go to the next screen and then comes back, the updated changes are not displayed in the datagrid.
In the code below, on editing the user datagrid and clicking on next button, the Order items screen is displayed and on click of Back button from Order items screen, the User screen is displayed but it is missing the updated changes in the user datagrid.
<data>
<collection id="usersDc"
class="com.company.test.entity.Users"
view="_local">
<loader id="usersDl">
<query>
<![CDATA[select e from test_Users e]]>
</query>
</loader>
</collection>
</data>
<layout>
<dataGrid id="usersGrid" dataContainer="usersDc" height="100%" width="100%" editorEnabled="true">
<columns>
<column id="id" property="id"/>
<column id="userName" property="userName"/>
<column id="firstName" property="firstName"/>
<column id="lastName" property="lastName"/>
<column id="emailId" property="emailId"/>
</columns>
</dataGrid>
<buttonsPanel>
<button id="btnNext" caption="Next"/>
<button id="btnBack" caption="Back"/>
<button id="btnCancel" caption="Cancel"/>
</buttonsPanel>
</layout>
User.java
@Subscribe
public void onInit(InitEvent event) {
usersDl.load();
}
@Subscribe("btnNext")
public void onBtnNextClick(Button.ClickEvent event) {
screens.create(Orderitem.class).show();
}
@Subscribe
public void onBeforeShow(BeforeShowEvent event) {
usersDl.load();
}
Orderitems.java
@Subscribe("btnOrderItemBack")
public void onBtnOrderItemBackClick(Button.ClickEvent event) {
screenBuilders.screen(this)
.withScreenClass(User.class)
.build()
.show();
}
Thanks,
Renuka