cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Larsen" <gary.lar...@envisn.com>
Subject RE: get selectionList for widget?
Date Thu, 08 Mar 2007 14:19:32 GMT
The solution below works for selection lists that defined in the form
definition with <fd:selection-list>.

For flow-jxpath selection lists I set up a hidden field with a delimited
string of possible values I could parse in the listener:

String valuestext = (String) selectionsWidget.getValue();
String[] values = valuestext.split("\\|\\|");
targetWidget.setValues(values);

gary
> 
> 
> AbstractDatatypeWidgetDefinition widgetDef =
> (AbstractDatatypeWidgetDefinition) myWidget.getDefinition();
> StaticSelectionList selList = (StaticSelectionList)
> widgetDef.getSelectionList();
> List selListItems = selList.getItems();
> 
> for (int i=0; i < selListItems.size(); i++) {
>     StaticSelectionList.SelectionListItem selListItem =
> (StaticSelectionList.SelectionListItem) selListItems.get(i);
>     MyClass value = (MyClass) selListItem.getValue();
> }
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message