Hello everyone,
Here is my acl script:
$doc=doc_open("C:\\Temp\\test.xml", 1);
$win=window_create('xui', 0x10, $doc, '300x800-1-1');
window_show($win,1);
Here is my XML file--test.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--Arbortext, Inc., 1988-2011, v.4002-->
<!DOCTYPE window PUBLIC "-//Arbortext//DTD XUI XML 1.1//EN"
"xui.dtd">
<window backgroundcolor="grey" focus="Cancel" height="200" modal="false"
orient="vertical" pack="start" title="Country Selection" width="500">
<box orient="vertical">
<radiogroup id="test1" label="Filtering Mode" orient="horizontal" pack="start"
resize="natural">
<radio id="Countrygroup1" label="Country group 1"></radio>
<radio id="Countrygroup2" label="Country group 2"></radio>
<radio id="Countrygroup3" label="Country group 3"></radio>
</radiogroup>
</box>
<spacer height="5"/>
<groupbox label="Select Country Code(s):" pack="end" resize="width">
<box id="test2" orient="horizontal">
<grid columns="3" resize="width">
<checkbox id="CountryA" label="Country A"></checkbox>
<checkbox id="CountryB" label="Country B"></checkbox>
<checkbox id="CountryC" label="Country C"></checkbox>
<checkbox id="CountryD" label="Country D"></checkbox>
<checkbox id="CountryE" label="Country E"></checkbox>
<checkbox id="CountryF" label="Country F"></checkbox>
</grid>
</box>
</groupbox>
<spacer height="10" resize="none"/>
<box pack="end">
<button label="OK" type="accept">
<script type="application/x-javascript" ev:event="domactivate">
var document = Application.event.target.ownerDocument;
var radiobox = document.getElementById("test1");
var checkbox = document.getElementById("test2");
var list1 = radiobox.getElementsByAttribute("checked", "true", 1);
var list2 = checkbox.getElementsByAttribute("checked", "true", 1);
for (var i = 0; i < list1.length; i++) {
Application.alert(list1.item(i).getAttribute("id"));
}
for (var i = 0; i < list2.length; i++) {
Application.alert(list2.item(i).getAttribute("id"));
};
var dialog = Application.event.view.window;
dialog.close();
</script>
</button>
<button id="Cancel" label="Cancel" type="cancel"></button>
</box>
</window>
How could I pass both list1 and list2 strings in my XML back to my acl script for further processing?
Your help will be greatly appreciated.
Sincerely,
Jing
Hi Jing Chang,
you can pass throw a string variable as parameter back to acl.
In Javascript:
Acl.eval("Packagename::Aclfunctionname('" + list1 + "')");
in ACL:
function Aclfunctionname($liststring)
{
#do further processing
message_box($liststring,0)
}
Hope that will help you.
Hello Hubert,
Thank you very much for your great help! It works very well after a few tries. Getting any help like this is so appreciated since I'm new to XUI and AOM programming.
Thank you once again for your kindness.
Sincerely,
Jing