Android Question Refreshing a B4Xtable when a B4XPages.ShowPage is issued again

Kevin Hartin

Active Member
Licensed User
I have a B4Xpage with a B4Xtable on it showing a list of receipts.

When I go back and create another receipt, then return to the Page, how do I force the table to update, as it is the same table.

I have another, which updates after a record is added or changed in a CustomLayoutDialog, but after the SQL updates I just run the Sub that populates the B4Xtable.

I suppose I am looking for the B4Xpages equivalent of an Activity_Resume in standard B4A.

Thanks,
Kev
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I have another, which updates after a record is added or changed in a CustomLayoutDialog
Don't use CustomLayoutDialog. Use B4XDialog.

When I go back and create another receipt, then return to the Page, how do I force the table to update, as it is the same table.
You need to call B4XTable.SetData with the updated data.
 
Upvote 0

Kevin Hartin

Active Member
Licensed User
Don't use CustomLayoutDialog. Use B4XDialog.


You need to call B4XTable.SetData with the updated data.
The issue is that where can I force the call to update the B4Xtable. Any update happen on another page, so I was looking for a solution when the page with the table gets the focus.
 
Upvote 0

Kevin Hartin

Active Member
Licensed User
Don't use CustomLayoutDialog. Use B4XDialog.


You need to call B4XTable.SetData with the updated data.
Bugger, I only converted from Panels to CustomLayoutDialog today....

Can I suggest a list of Current "recommended" ways of doing things and "depreciated" or less desirable ways.

When I search the forums, it is often confusing as to what is current.

Another issue which I will post on soon is the subject of 3rd Party libraries, wrapping, library porting and using JavaObject to access non "B4X native" libraries. It is a bit overwhelming.

Thanks,
Kev
 
Upvote 0

Kevin Hartin

Active Member
Licensed User
One useful thing about B4XPages is that you can "share" Views between pages. So, set your B4XTable as Public and update it from other pages.
Or you should use the B4XPage_Appear event.
OK, I have a Page class called PagePOS, which changes the data that makes up the table in class PageReceipt, which has a sub called ShowTable that initialises and populates the B4Xtable.

How do I call the ShowTable sub in PageReceipt from a sub in PagePOS after I do something that changes the data?

Kev
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…