i have a collection generated by JAXB that i want to associate to a selectManyListbox for multi-selection.
Here is the JSF:
<h:selectManyListbox value="#{field.textValueLookup.value}" size="5" >
<f:selectItems value="#{consultaController.getOpcionesLookup(field.queryField)}"/>
</h:selectManyListbox>
and this is the TextValueLookup class generateb by JAXB
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.10.15 at 06:52:09 PM CEST
//
package es.ine.iria2.query.jaxb.complexQuery;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://iria.ine.es/schemas/complexQuery.xsd}value" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="operator" use="required" type="{http://iria.ine.es/schemas/complexQuery.xsd}TextLookupFilterOperatorType" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "textValueLookup")
public class TextValueLookup {
protected List<String> value;
@XmlAttribute(required = true)
protected TextLookupFilterOperatorType operator;
/**
* Gets the value of the value property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the value property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getValue().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getValue() {
if (value == null) {
value = new ArrayList<String>();
}
return this.value;
}
/**
* Gets the value of the operator property.
*
* @return
* possible object is
* {@link TextLookupFilterOperatorType }
*
*/
public TextLookupFilterOperatorType getOperator() {
return operator;
}
/**
* Sets the value of the operator property.
*
* @param value
* allowed object is
* {@link TextLookupFilterOperatorType }
*
*/
public void setOperator(TextLookupFilterOperatorType value) {
this.operator = value;
}
}
The problem is that the jaxb class generated lacks of a setter value for the value collection and when the selectManyListbox is submitted (ajax or form) it throws this error:
Target Unreachable, 'null' returned null: javax.el.PropertyNotFoundException: /consultaCompleja/seleccionCamposFiltro.xhtml @39,18 value="#{field.textValueLookup.value}": Target Unreachable, 'null' returned null
Any workaround?