Files
aws/web_elements/javascripts/aws_func_xml.tjs
Pascal Obry 5c3fac9f46 Add support for adding Ajax action in table.
To be able to add a set of Ajax actions into a TABLE
statement we need to be able to specify unique JavaScript
id/name. For this a new parameter has been added to be
able to pass an ID_INDEX (as parameter 18). For example
this parameter can be passed the @_TABLE_LINE_@ tag.
2009-07-03 16:22:14 +00:00

71 lines
2.0 KiB
Plaintext

@@-- $1 action name onclick, onfocus
@@-- $2 the tag node ID to handle in the DOM tree
@@-- $3 a set of parameters to pass to the URL
@@-- $4-$8 are linked fields id to this request, all fields are passed as
@@-- $18 ID index to be added to $2 (index in table for unique id for ex)
@@-- $19 URL to call instead of the generated one
@@-- $20 the name of a function to call when this routine terminate
@@--
@@-- The final request is : /$1$$$2?$3&$4=value($4)&$5=value($5)
@@-- or : $19?$3&$4=value($4)&$5=value($5)
@@-- with value(name) being the value for the field named "name".
@@SET@@ XML_ACTION = $1
@@SET@@ XML_ID = $2
@@SET@@ XML_PARAMETERS = $3
@@SET@@ XML_F1 = $4
@@SET@@ XML_F2 = $5
@@SET@@ XML_F3 = $6
@@SET@@ XML_F4 = $7
@@SET@@ XML_F5 = $8
@@SET@@ XML_ID_INDEX = $18
@@SET@@ CONSTANT_URL = $19
@@SET@@ XML_ONCOMPLETE = $20
{
@@IF@@ @_CONSTANT_URL_@ /= ""
var rurl="@_CONSTANT_URL_@";
@@ELSE@@
var rurl="/@_XML_ACTION_@$@_XML_ID_@@_XML_ID_INDEX_@";
@@END_IF@@
var rpars = "";
var roncomplete = "";
@@IF@@ @_XML_PARAMETERS_@ /= ""
rpars = "@_XML_PARAMETERS_@";
@@END_IF@@
@@IF@@ @_XML_F1_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_XML_F1_@');
@@END_IF@@
@@IF@@ @_XML_F2_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_XML_F2_@');
@@END_IF@@
@@IF@@ @_XML_F3_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_XML_F3_@');
@@END_IF@@
@@IF@@ @_XML_F4_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_XML_F4_@');
@@END_IF@@
@@IF@@ @_XML_F5_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_XML_F5_@');
@@END_IF@@
@@IF@@ @_XML_ONCOMPLETE_@ /= ""
roncomplete = @_XML_ONCOMPLETE_@
@@END_IF@@
AWS.Ajax.XML.request (rurl, rpars, roncomplete);
return (false);
}