cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

listdropdown, listitem in XUI toolbar

Newbie

listdropdown, listitem in XUI toolbar

Hi,

Can someone tell me how to handle the events on a listitem in a listdropdown in a toolbar? I tried to add a notify callback, but I can't get it to work.

Thanks!

JG
Tags (2)
1 REPLY 1
Highlighted

RE: listdropdown, listitem in XUI toolbar

Here is a
pair of functions we're using todisplay a XUI (provided), get (not
provided), and set (provided) a Topic to be insertedinto
changetracking markup later via a hook. The bit you asked about are the
lines containing acl.eval such as:

face="Century Schoolbook">
Acl.eval("save_topicid('" + "')");

Probably
there are other ways to do this. I'd be interested in seeing
code!

face="Century Schoolbook">

face="Century Schoolbook">

function
displayTopicChooserDialog() {
# Create the topics dialog

local dtdpath = $main::adept_path.'/doctypes/xui/xui.dtd';
xuidoc =
doc_open('', 0x10100, '', '', dtdpath);
if (xuidoc < 0)
{
return;
}


local
xuicontent = \
'<window title="Topics" xmlns:ev="&lt;A" <br="/>href='http://www.w3c.org/2001/xml-events">\'>http://www.w3c.org/2001/xml-events">\

<box orient="vertical" alight="center" height="300" width="600" <br="/>pack="center">\

<box orient="horizontal" align="center" <br="/>pack="center">\

<box orient="vertical" alight="center" <br="/>pack="center">\

<label label="Choose" a=" <br="/>topic:"/>\

<combobox id="topicid" value="General" edits=" (no=" changebars)|&quot;=" <br="/>type="dropdownlist" resize="height" height="75"
width="550">\

<listitem id="geneditsnocb" label="General" edits=" (no=" <br="/>changebars)|"/>\

<listitem id="geneditscb" label="General" edits=" <br="/>(changebars)|cb947"/>\

<listitem id="indexedits" label="Index" edits=" (no=" <br="/>changebars)|"/>'


xuicontent = xuicontent . GetTopics();



xuicontent = xuicontent
.\

'</combobox>\

</box>\

</box>\
<box <br="/>orient="horizontal" align="center"
pack="center">\

<button label="OK" <br="/>type="accept">\

<script type="application/x-javascript" <br="/>ev:event="domactivate">\

var document =
Application.event.target.ownerDocument;\

var value =
document.getElementById("topicid").getAttribute("value");\

Acl.eval("save_topicid('" + value +
"')");\

// Application.alert("All tracked changes will be associated with the " + value
+ " topic. id = " +
id);\

var dialog =
Application.event.view.window;\

dialog.close();\

</script>\

</button>\

<button label="Cancel" <br="/>type="cancel">\

<script type="application/x-javascript" <br="/>ev:event="domactivate">\

var document =
Application.event.target.ownerDocument;\

// var value =
document.getElementById("topicid").getAttribute("value");\

// var id =
document.getElementById("topicid").getAttribute("id");\

Acl.eval("save_topicid('" +
"')");\

// Application.alert("All tracked changes remain associated with the " + value +
" topic. id = " +
id);\

var dialog =
Application.event.view.window;\

dialog.close();\

</script>\

</button>\

</box>\

</box>\
</window>';

insert(xuicontent, xuidoc);



xuiwin = window_create('xui', 0x10, xuidoc);
if (xuiwin < 0)
{
return;
}

function
save_topicid(selected_topic) {
if (trim(selected_topic) == ")
{
ShowEditingTopic();
return;
}


face="Century Schoolbook">sep_pos = index(selected_topic,"|");
#
response("sep_pos = " . sep_pos);

topicid_start = sep_pos +
1;
# response("topicid_start = " .
topicid_start);

length_topicname = sep_pos - 1;
#
response("length_topicname = " . length_topicname);

global
saved_topicname = substr(selected_topic, 1, length_topicname);
#
response("saved_topicname = " . saved_topicname);

global
saved_topicid = substr(selected_topic, topicid_start);
length_topicid =
length(saved_topicid);
# response("length_topicid = " .
length_topicid);

if (saved_topicid == 'cb947')
{
set changetracking = on;
topicmsg = 'Change
Tracking is ON but changes will not be associated with a
topic.'
response($topicmsg);
}
else if
(length_topicid > 0) {
set changetracking =
on;
topicmsg = 'Change Tracking is ON and changes will be
associated with the ''' . $saved_topicname . '''
topic.'
response($topicmsg);
}
else
{
delete(saved_topicid);
set changetracking =
off;
local topicmsg = 'Change Tracking is OFF and changes will
not be associated with a
topic.'
response($topicmsg);
}
#
response("saved_topicid = " . saved_topicid);
}

face="Century Schoolbook">


Announcements