I am new to Cuba Studio. I have created an application with a main screen that contains a table that displays data. This table in the main screen should auto update or refresh when data in main table changes. My question is: How do i refresh the main screen when i close all the open tabs? Currently i have to logout and login again to see the changes but this is not reliable.
public class ExtAppMainWindow extends AppMainWindow {
@Override
public void init(Map<String, Object> params) {
super.init(params);
workArea.addStateChangeListener(newState -> {
if (newState == AppWorkArea.State.INITIAL_LAYOUT) {
// update data here
}
});
}
}
I added projectdatasource.refresh() to refresh the table but it is giving me a NullPointerException. I dont understand why? Can you please brief me on how to update data on the main screen.
I managed to figure it out. I changed the name of the datasource projectsDs to projectdatasource and it couldn’t be found that’s why it was returning a NullPointerException.