PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 21 → Update Combo_Intro after Ajax call
Update Combo_Intro after Ajax call
Débuté par Tony Turner, 07 fév. 2017 07:37 - 1 réponse
//hostimage.webdev.info/avatars/default.gif
Posté le 07 février 2017 - 07:37
Hi,

I am using ajax to update some db data, i don't want to wait for the ajax to finish but when it does finish I want to run
ListDisplay(Combo_Intro,tainit) to refresh the list box based on the modified data.

I can't see how I can do that using AJAXExecuteAsynchronous as you cant use ListDisplay(Combo_Intro,tainit) within the server procedure, it doesn't error it just doesn't do anything if I put it on the code after the db data update.

It all works in the sence that the data update I get a message saying saved.

But how can I refresh the Combo_Intro control ?

IF AJAXAvailable() = True THEN
// Run the server procedure named "MyProc"
// As soon as the result of the "MyProc" server procedure becomes available,
// the "ProcResult" browser procedure will be run
Res is int
Res = AJAXExecuteAsynchronous(ModifyData,ProcResult,gsNumber,"COMBO_Intro",COMBO_Intro..Value)
// The following processes are run without waiting for the result
ELSE
// do nothing here for now
END


Procedure ModifyData(Number is string, sUpdateData is string,sNewVal)

update db Data

// this does nothing and no error so I need to update control when browser proc is run how pls?
ListDisplay(Combo_Intro,taInit)


Procedure ProcResult(ModifiedData, Res)
ToastDisplay("Saved",toastShort,vaTop,haCenter,iLightRed)


How can the Browser procedure refresh the list box which is initialised by the server code?

Thanks

Tony
//hostimage.webdev.info/avatars/default.gif
Posté le 07 février 2017 - 10:49
Hi Tony,

look at the ajaxUpdateControls option of ajaxexecuteasynchronous

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 2/7/2017 à 1:37 AM, Tony Turner a écrit :
Hi,

I am using ajax to update some db data, i don't want to wait for the
ajax to finish but when it does finish I want to run
ListDisplay(Combo_Intro,tainit) to refresh the list box based on the
modified data.

I can't see how I can do that using AJAXExecuteAsynchronous as you cant
use ListDisplay(Combo_Intro,tainit) within the server procedure, it
doesn't error it just doesn't do anything if I put it on the code after
the db data update.

It all works in the sence that the data update I get a message saying
saved.

But how can I refresh the Combo_Intro control ?

IF AJAXAvailable() = True THEN
// Run the server procedure named "MyProc"
// As soon as the result of the "MyProc" server procedure becomes
available, // the "ProcResult" browser procedure will be run
Res is int
Res =
AJAXExecuteAsynchronous(ModifyData,ProcResult,gsNumber,"COMBO_Intro",COMBO_Intro..Value)

// The following processes are run without waiting for the result
ELSE
// do nothing here for now
END


PROCEDURE ModifyData(Number is string, sUpdateData is string,sNewVal)

update db data

// this does nothing and no error so I need to update control when
browser proc is run how pls?
ListDisplay(Combo_Intro,tainit)


PROCEDURE ProcResult(ModifiedData, Res)
ToastDisplay("Saved",toastShort,vaTop,haCenter,iLightRed)


How can the Browser procedure refresh the list box which is initialised
by the server code?
Thanks

Tony