-
FEATURED COMPONENTS
First time here? Check out the FAQ!
![]() | 1 | initial version | |
How can I use a variable resolver with a ListBox.
I have tried the following approaches:
<listbox mold="select" width="100px" selecteditem="@bind(each.attributes.accountCategory.value)"> <listitem label="${each.value}" foreach="${country}" value="${each.code}"/> </listbox>
The Lov display but the value in field accountCategory does not display.
OR
<listbox model="${country}" mold="select" width="200px" selecteditem="@bind(each.attributes.accountCategory.value)"> <template name="model" var="lov"> <listitem label="${lov.value}" value="${lov.code}"/> </template> </listbox>
The above code snippet throws errors.
Points to note:
My data source is a class that has a map of attributes.
I have implemented a variable resolver that returns the list of values as follows:
@Override public Object resolveVariable(String name) throws XelException {
.... // some code here
List<GenericLOV> listOfValues = new ArrayList<GenericLOV>();
listOfValues.add(new GenericLOV(new Short("566"), "Nigeria"));
listOfValues.add(new GenericLOV(new Short("891"), "Yugoslavia"));
listOfValues.add(new GenericLOV(new Short("894"), "Zambia"));
ListModelList<GenericLOV> listModelLov = new ListModelList<GenericLOV>();
listModelLov.addAll(listOfValues);
return listModelLov;
}
The GenericLov is a class that has two fields
private Short code; private String value;
with getters and setters
![]() | 2 | No.2 Revision |
How can I use a variable resolver with a ListBox.
I have tried the following approaches:
<?variable-resolver class="com.LovResolver"?>
<listbox mold="select" The Lov display but the value in field accountCategory does not display.
OR
<listbox model="${country}" mold="select"
1)
My data source is a class that has2)
I have implemented a
@Override
3)
The GenericLov is a class that has two fields
private Short code;
private String