- Result of the server procedure
- Procedures that can be called by AJAX
- Miscellaneous
- Older browsers
AJAXExecuteAsynchronous (Function) In french: AJAXExécuteAsynchrone Runs a server procedure without refreshing the page. This function is not locking. The other processes continue to run (no matter whether the result of the procedure run is retrieved or not). As soon as the result of the server procedure is available, AJAXExecuteAsynchronous automatically calls a browser procedure used to retrieve this result. To avoid locking the processes as long as the result of server procedure run is not retrieved, use AJAXExecute.
// AJAX supporté sur le navigateur en cours? IF AJAXAvailable() = True THEN // Exécution de la procédure serveur "MaProc" // Dès que le résultat de la procédure serveur "MaProc" sera disponible, // la procédure navigateur "ProcRésultat" sera exécutée Res is int Res = AJAXExecuteAsynchronous(MaProc, ProcRésultat, NomClient, Bonus) // Les traitements suivants s'exécutent sans attendre le résultat ... ELSE // Traitements sans utilisation de AJAX ... END
// -- Procédure serveur MaProc // -- // Procédure permettant de rechercher les données à modifier dans la page PROCÉDURE MaProc(ClientNom, TauxRed) // Recherche des données à modifier ... // Renvoie le résultat RETURN LeRésultat
// -- Procédure navigateur ProcRésultat // -- // Procédure appelée automatiquement dès que le résultat de la procédure "MaProc" est disponible // Le paramètre "DonnéesModifiées" correspond au résultat de la procédure serveur MaProc PROCÉDURE ProcRésultat(DonnéesModifiées, Res) // Analyse du résultat et mise à jour des champs modifiés ...
Syntax
<Result> = AJAXExecuteAsynchronous([<Options>, ] <Server procedure> , <Browser procedure> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Integer Identifier of the call to <Server procedure>. This identifier will be used by the other AJAX functions. <Options>: Integer constant Update mode: | | New in version 28ajaxPostValueOfControls | The value of all the fields of the Page must be sent to the server. The Procedure WLanguage server will use the value of the fields currently being entered in the browser. | ajaxStraightCall (default value) | Modified controls are not refreshed in the page. | ajaxSynchronizeServerVariables | The Ajax call will send variables with the <Browser synchronized> attribute. | ajaxUpdateControls | Modified controls are automatically refreshed in the page. | ajaxWithoutLockingAWPContext | The Ajax call will not use the AWP context. Therefore, this context will not be locked. Used to parallelize the Ajax calls on the server. Caution: This constant has no effect in page or project GO. | Caution: these constants must be used directly (no variable can be used to store their value). <Server procedure>: Procedure name Name of server procedure to run (global or local procedure). This procedure is used to find the data to be modified in the page. This procedure has the following format:
PROCEDURE <Procédure serveur> (<Paramètre 1>, <Paramètre 2>, ...)
This procedure must be allowed to be called by AJAX (see the Notes). <Browser procedure>: Procedure name Name of browser procedure (global or local procedure) automatically run as soon as the result of <Server procedure> becomes available. This procedure has the following format:
PROCEDURE <Procédure navigateur> (<Résultat de la procédure serveur>, <Identifiant de la procédure serveur>)
where: - <Result of server procedure> is a character string corresponding to the result returned by the <Server procedure>.
- <Identifier of server procedure> is an integer that corresponds to the identifier of the call to <Server procedure> (<Result> parameter of AJAXExecuteAsynchronous).
<Parameter 1>: Optional character string First parameter passed to <Server procedure>. Caution: Only simple types can be used (character string, integer, etc.). Structured types cannot be used. <Parameter N>: Optional character string Nth parameter passed to <Server procedure>. Caution: Only simple types can be used (character string, integer, etc.). Structured types cannot be used. Remarks Result of the server procedure <Server procedure> is used to search for data to be modified in the page. The result of this procedure (which means the data to modify) can be contained in a character string or in an XML document (created and handled by the XML functions). To send this result back to the browser, use the RETURN keyword and specify: - the character string that contains the data.
- the name of the XML document that contains the data.
<Browser procedure> is automatically run as soon as this result becomes available. The first parameter of <Browser procedure> contains this result. Then, this result must be used to refresh the data to be modified. If this result corresponds to the name of an XML document, this document will be automatically transmitted and created on the browser. Then, this document can be handled by the XML functions. Remark: When using an XML document: - the XML document is not automatically deleted from the server when it is transmitted to the browser.
- if an XML document with the same name is already found on the browser, the new XML document automatically replaces the former one.
Procedures that can be called by AJAX To secure the WEBDEV sites, the server procedures are protected from illegal calls (attempt to re-route a session for example). To run a server procedure from a browser process ( AJAXExecute or AJAXExecuteAsynchronous), you must allow this procedure to be called by AJAX. To allow a server procedure to be called by AJAX, click "AJAX" in the procedure bar: Procedure that cannot be called by AJAXProcedure that can be called by AJAXOlder browsers AJAXAvailable is used to determine if the current browser supports AJAX technology. If a process that uses AJAX is run on a browser that does not support this technology, the process is run "as if" it did not use AJAX (e.g., the entire page is refreshed). Business / UI classification: Neutral code
|
|
|
|