PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WB19] How to PageDisplayDialog from AJAX Table?
[WB19] How to PageDisplayDialog from AJAX Table?
Débuté par Herro, 20 aoû. 2014 12:50 - 5 réponses
Posté le 20 août 2014 - 12:50
Hi,

I have table (AJAX) in a page. I want to display a page (PageDisplayDialog) by clicking on a button in a tabelrow.

Adding a button in a table (webdev) is nog possible so I tried to replace the button with an image (COL_Details) and set the "link column"-property to true (tab details from table control) with action "None". Now the proces "Click of COL_Details" of the imagecolumn is available. (F2 on COL_Details).

But when I try to call a page by PageDisplayDialog, there is an error "page display dialog is not allowed to be run in AJAX server code". I can understand this because the table is in AJAX-mode.

Next i created a button (BTN_Modify) with process "On click" -> CallDisplayDialog (no Ajax).
Clicking on this button works fine. So far so good.

But when ik start this process from the proces "Click of COL_Details" by using the code "ExecuteProcess(BTN_Modify,trtClick)" then again I have the same error.

So: How to call a page (PageDisplayDialog) from a row of a AJAX-table in Webdev?
Posté le 20 août 2014 - 13:11
Hi,

Have you tired adding the 'double click (ondblclick)' process to your table then adding the following code into it

ExecuteProcess(BTN_Modify,trtClick)"

iso
Posté le 20 août 2014 - 13:29
Hi,

directly, it's not possible...

However, you can go around the problem like so:
- in the browser click code of your table row/column/fake button, you start a timer (1/10 of a second)
- in the code of the procedure called by the timer, you are NOT in ajax code anymore, therefore yo can do whatever you want, like your executeprocess of the modify button

Best regards
Posté le 20 août 2014 - 20:40
Hi iso,

Double click gaves the same result (error). But the solution of Fabrice did the trick (using a timer).
Posté le 20 août 2014 - 20:41
Hi Fabrice,

Great. Problem solved. Very creative solution. <img src="/NG2013_WEB/ui/smiley/1.gif" align=absmiddle border=0 alt=":-)"> but it works fine.
Thanks a lot.

Best regards,
Herro
Posté le 23 août 2014 - 12:22
Hi Guys,

It is perfectly possible to call a button that does a PageDisplayDialog from browser code in an Ajax table.
The elegant solution is the one suggested by Iso, but was ignored.
It is also possible from an image column using the image click code (browser)
Just don't set the button server code in Ajax mode.

Regards,
Piet