// assuming we have a nodeList

var max = nodeList.getLength();

var list = new Array(max);

for(var i=1; i < max; i++) {

   var elem = nodeList.item(i);

   var code = elem.getAttribute("code");

   var label = elem.getAttribute("description");

   list[i] = {value:code, label:code}

}

 

someWidget.setSelectionList(list, "value", "label");

 

Joe

 

 

Richard Huegill wrote:

We are attempting to use a selection list in flow script, that are we want to populate from java code.

Is there an easy way in flow of populating a widget from a collection of java beans.

I've seen lots of examples of

 

var states = {"" : ""}

showform(url, {"states" : states);

 

but we have a number of dynamic lists that are generated, and so I'm not sure if this approch works.

 

I've seen code that looks like

 

widget.setSelectionList(anObject, "value", "label");

 

but can't find any examples of how to create the 'anObject' in the correct form to be able to be used from teh flowscript.

 

Thanks in advance.

 

Richard

 

 

Reply via email to