Welcome! Log In Create A New Profile

Advanced

[WB28] - Updating a table in a page

Posted by JP 
JP
[WB28] - Updating a table in a page
July 18, 2023 01:39PM
Hi Al

WebDev 28

I have a page with a table. If I populate this table from the table init code then all displays OK. However, I have a button which the user can press and which then will populate the table with new data. The button click code runs, the new data is added to the table (confirmed) but the table does not display the new content.

The table is not linked to a table or query. It is populated programmatically. So the same code in the init code of the table works but called in the button click code works but does not change the table's contents ...

Any ideas why?

Thanks



Edited 1 time(s). Last edit at 07/18/2023 01:52PM by JP.
Argus
Re: [WB28] - Updating a table in a page
July 18, 2023 08:14PM
Probably because the page is displayed again to display your new data, but THAT runs the page and table init code, and your init code reload the initial data...

Having any data related loading in the INIT codes is a bad idea on the web, as this code is redone often
JP
Re: [WB28] - Updating a table in a page
July 18, 2023 08:34PM
Argus,

Thanks for the reply but thats not it. I deleted the init code (which was just for testing). The page loads and the table is empty. The user can select a few parameters and click a button to generate the table. The button click code adds rows to the table using TableAddLine(). I check that the rows have been added by showing them in an INFO() dialog. All good. But the table does not refresh any of the data I added.

Site is an AWP site. Table is Server+Ajax. Button click code is Ajax enabled. It runs, it adds lines, but the table does not reflect the added lines.



Edited 1 time(s). Last edit at 07/18/2023 08:34PM by JP.
JP
Re: [WB28] - Updating a table in a page
July 18, 2023 08:42PM
Argus

If I make the table a Server No Input Pager then the data I added shows in the table. But then I lose all ability to sort the table columns etc. So it works as Server No Input Pager but not as Server + Ajax mode. ... ?
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: