Refresh/Re-Bind List View?

0
I have a List View on a tab container that has a microflow data source.  The microflow retrieves the entities from an external source through a Java action and the model entities are not persisted.  When the page loads, the microflow executes and populates the list view as expected.   Each row in the list view contains some buttons that operate on the specific item in the list view (Delete, for example).  When the button is clicked, I can execute the appropriate action (nanoflow or microflow) without any issues and retrieve the updated list of entities by calling the microflow used as the data source, however the list view does not get refreshed.   The only way I have found to refresh the list view is to use a Reload action in the button microflow or nanoflow, which reloads the entire page and shifts focus to the default tab, which is not acceptable.   How can I refresh/re-bind the list view with the newly retrieved list of non-persisted entities without changing the focus from the current tab?
asked
2 answers
0

Hi Tim,

 

I would suggest a slight change to your data model.  You could add a helper entity that can be a parent to the list of NPEs in the list.

image.png

Then, instead of having the listview populated by microflow, you will add a dataview that retrieves the data and creates the NPEs and returns the helper entity.  You can then add a listview inside of the dataview that displays the data by association to the helper entity.  This way, you will be able to manipulate the entities that are associated to the helper entity and the list should update accordingly.

 

Another option could be to use a custom tab widget that allows you to select the default tab dynamically when the page reloads.  I have used TabPageSelector  before but Tab Switch is perhaps more up to date and should accomplish the same thing.

 

Hope this helps!

answered
-1

You could pass the list of non-persistent entities back into your Java Action, then update relevant attributes in the NPEs in your Java code. That way it would still be the same NPEs that are on the page and it should retain focus.

 

Good luck!

answered