|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
| [WB21] - Table row selection |
| Iniciado por guest, 01,jul. 2016 13:57 - 4 respuestas |
| |
| | | |
|
| |
| Publicado el 01,julio 2016 - 13:57 |
Hi All
WebDev Classic
Here is a strange one; I have a table on a page. Table is an Ajax table. It contains some rows. When I click on the table row I test what row I clicked on using TABLE_MyTable..Value. This code is in the Row Selection Browser code. But it always returns the PRIOR row that was selected and not the row I am currently selecting and which is actually highlighted on the table itself. What am I doing wrong?
TIA |
| |
| |
| | | |
|
| | |
| |
| Publicado el 03,julio 2016 - 16:37 |
selection based on browser code is not a good idea !! better do it with servercode
maybe use: table selectplus()
regards Allard |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,julio 2016 - 09:53 |
Allard
Thanks for the reply.
The problem is that I need to submit the row selected to the server for processing and return a page to the user according to the row selected in the table. I think the following is my problem:
1) The table must be Ajax since it is populated according to prior conditions.
2) The table cannot call PageDisplay() in the "Ajax enabled server code" of the table - this is a WebDev restriction
3) So Fabrice suggested in the Table Browser Click code to call the click code of a hidden button using ExecuteProcess()
4) The hidden button non-Ajax server code then runs the PageDisplay() to display the appropriate page according to the table row selected.
The above works 9 out of 10 times. But ...
Putting the row selection test in the Table Row Selection Server code is fine except that the hidden button ExecuteProcess() must be in the (non-Ajax) Table Browser click code. It cannot run from the Ajax Table Server Row Selection.
And the problem is: the Table Row Selection Browser code executes first before the Table Row Selection Server code ...
So one ultimately is dependent on the Browser code having the right table row selected info.
Surely there is a way to solve this as I would imagine this is standard stuff?
tia |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,julio 2016 - 21:05 |
Hi,
I think you want to display something based on a table value. Iam I right? Is the value of the table a representation of a database table value?
Because if it is you could just use the table as the pointer in the hreadseek() function.
Like this:
If hreadseekfirst( filename, id, yourtable) then
Pagedisplay( yourpage) End
You can put this code in a buttun without ajax.
regards Allard |
| |
| |
| | | |
|
| | |
| |
| Publicado el 09,julio 2016 - 12:45 |
Allard,
If I force the user to click a button with the PageDisplay() code it works 100% of the time. The button gets the correct table row and all good.
But if I try and make life easier for the user and use ExecuteProcess( BTN click code ) from the table browser click code in order to automatically, i.e. immediately, load the required page then this works only perhaps 9/10 times. When it fails it is because the table loses its table row value between selecting the row and the button click code firing.
I have noticed that the table also sometimes shows a loading animation over it after I click a row. I believe that this animation might be related to the problem.
The other problem with tables is that if the table is set to re-size / anchor with the browser height then when selecting a row under IE it flashes (disappears and re-appears) and under Edge it collapses to 1 pixel height. I think there is a bug in the table control under these circumstances.
The only sure solution is (1) don't allow the table to re-size with browser (solves flashing/collapsing issue), and (2) force the user to manually click a button to load a page (solves the table row losing its value). |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|