I am doing a bit of experimentation, a POC if you will, and I wanted to
see if anyone has an example of something like this working. In fact it
doesn't have to be implemented this way, the idea is to dynamically
generate some fields on a request form and have *some* method of
retrieving the values there. Could be done on submit instead of this way
or any other way that works...

What I tried:

I created a table and in it some query dynamically generated fields and
what I want to do is whenever the user changes on of those fields
(onchange) we update a hidden pick list in the form so we can forward
these changes out.

So I busted open the WAR and found the source code for the JUICE stuff
and it seemed straightforward enough, I have used this based on a cool
solution before to create buttons on my form like this:

function addButton(field,name,label)
var ctrl = JUICE.UICtrlUtil.getControl(field.getName());
var btn = JUICE.UICtrlUtil.addButton(ctrl, name , label, name,
function() {field.fireEvent(field.getName()+name,field.getNam e())});


Put that in global functions, include a call to that in your onload and
you get a button which fires an event with the name being the label on
the button...works beautifully.

So now on to what doesn't work...I want to get a lot more sophisticated
and call this from some HTML. I got my controls rendering fine so it
looks OK, but I can't seem to get the events to fire...or if I am the
call to JUICE to get / set the second list box is not working.

Here's what I have in my HTML field:
function table(IDVault,form,field)
var R = "<table>";
R = R + "<tr><td>System Name</td><td>Logon ID</td></tr>";
var Apps = IDVault.globalQuery(null, "Mainframe-Apps");
var ctrl = JUICE.UICtrlUtil.getControl(field.getName());
for (var i=0; i < Apps[0].length; i++)
R = R + "<tr>";
R = R + "<td><input class=\"nv-formFieldLabel\" type=\"checkbox\"
name=\"ctrl=CB+" + Apps[0][i] + "\">";
R = R + Apps[1][i] ;
R = R + "</input></td>";
R = R + "<td><input id=\""+Apps[1][i]+"\" onchange=\"";
//get instance of control
R = R + "var ctrl = JUICE.UICtrlUtil.getControl('test2')';";
//get all values
R = R + "var allValues = JUICE.UICtrlUtil.getAllValues(ctrl);";
//look up this row's label
R = R + "var dex = allValues[0].indexOf(this.id)";
// if it's not in the list it must be an add
R = R + "if (dex == -1) {";
R = R + "allValues[0][allValues[0].length] = this.id;
// if it's found and the value is blank we need to delete the row
R = R + "else {";
R = R + "if (this.value == '') {";
R = R + "allValues[0][dex] =
allValues[0][allValues.length-1];allValues[1][dex] =
R = R + "else { ";
R = R + "allValues[1][dex] == this.value; };";
R = R + "}";
R = R + "
R = R + "\"";
R = R + "type=\"text\" class=\"nv-fontExtraSmall\" name=\"ctrl=TB+";
R = R + Apps[0][i]+"\"/>";
R = R + "</td></tr>";
R = R + "</table>";
return R;

All assistance greatly appreciated

rrawson's Profile: https://forums.netiq.com/member.php?userid=403
View this thread: https://forums.netiq.com/showthread.php?t=47049