syntax_editor_macros
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
syntax_editor_macros [01/07/2025 13:13] – johnsonjohn | syntax_editor_macros [01/07/2025 13:16] (current) – johnsonjohn | ||
---|---|---|---|
Line 37: | Line 37: | ||
====c_GeneratingMessages==== | ====c_GeneratingMessages==== | ||
< | < | ||
+ | //text | ||
+ | //alert(), addInfoMessage(), | ||
+ | |||
+ | //Context: Most client side code. | ||
+ | |||
+ | //Ways to generate messages from client side code: | ||
+ | //Use the alert() function to show a prominent and blocking modal dialog which must be explicitly dismissed for execution to continue. | ||
+ | //Display a message to the user from Client code using g_form.addInfoMessage() or g_form.addErrorMessage() | ||
+ | //Use g_form.addDecoration() to show a small graphic symbol by a form field label. | ||
+ | //Use g_form.flash() to display a flashing colored background box behind a form field label. | ||
+ | //Use the confirm() function to display a modal popup dialog to get a response (OK or Cancel) from the user before continuing execution. | ||
+ | //Use the jslog() function to write a message to the web browser console. | ||
+ | function onLoad() { | ||
+ | alert(" | ||
+ | |||
+ | g_form.addErrorMessage(" | ||
+ | g_form.addInfoMessage(" | ||
+ | |||
+ | g_form.showFieldMsg(" | ||
+ | g_form.showFieldMsg(" | ||
+ | g_form.showFieldMsg(" | ||
+ | g_form.showFieldMsg(" | ||
+ | |||
+ | jslog(" | ||
+ | |||
+ | g_form.addDecoration(" | ||
+ | g_form.addDecoration(" | ||
+ | g_form.addDecoration(" | ||
+ | |||
+ | g_form.flash(" | ||
+ | |||
+ | var vResult = confirm(" | ||
+ | g_form.addInfoMessage(vResult); | ||
+ | } | ||
</ | </ | ||
---- | ---- | ||
Line 43: | Line 76: | ||
====c_GlideAjaxMethod==== | ====c_GlideAjaxMethod==== | ||
< | < | ||
+ | //text | ||
+ | // | ||
+ | |||
+ | //From client side code, to invoke server side code asynchronously, | ||
+ | //Use the addParam() function, and by convention, the parameter named " | ||
+ | // | ||
+ | //Use getXMLAnswer() to invoke the server-side function and specify a callback function; in this example " | ||
+ | //Use a direct parameter in your callback function to make use of data returned by the server; in this case the parameter is named " | ||
+ | function onLoad() { | ||
+ | g_form.addInfoMessage(" | ||
+ | |||
+ | var ga = new GlideAjax(' | ||
+ | ga.addParam(" | ||
+ | ga.getXMLAnswer(finishClientSideWork); | ||
+ | |||
+ | g_form.addInfoMessage(" | ||
+ | |||
+ | var ga2 = new GlideAjax(' | ||
+ | ga2.addParam(" | ||
+ | ga2.addParam(" | ||
+ | ga2.getXMLAnswer(finishClientSideWorkTWO); | ||
+ | |||
+ | g_form.addInfoMessage(" | ||
+ | } | ||
+ | |||
+ | function finishClientSideWork(answerFomServer) | ||
+ | { | ||
+ | g_form.addInfoMessage(" | ||
+ | g_form.addInfoMessage(" | ||
+ | g_form.addInfoMessage(" | ||
+ | } | ||
+ | |||
+ | function finishClientSideWorkTWO(answerFomServerTWO) | ||
+ | { | ||
+ | g_form.addInfoMessage(" | ||
+ | g_form.addInfoMessage(" | ||
+ | g_form.addInfoMessage(" | ||
+ | } | ||
</ | </ | ||
---- | ---- |
syntax_editor_macros.1736284394.txt.gz · Last modified: 01/07/2025 13:13 by johnsonjohn