The selectOneMenu binding object is null. And this is my code:
Here is the dataTable:
<t:dataTable id="datalist" width="100%" border="0" cellpadding="0"
cellspacing="0"
columnClasses="defaultCol" headerClass="tableHead"
style="cursor:pointer; vertical-align:top"
rowClasses="zebraTableContentOdd,zebraTableContentEven" rows="20"
value="#{packageLines.packageLineList}"
var="packageLine">
In the dataTable there is a column. As you can see, there is a binding
for the selectOneMenu:
<t:column>
<f:facet name="header">
<h:outputText
value="#{message['lineAllocation.tableColumn.productionLine']}"></h:outputText>
</f:facet>
<t:selectOneMenu id="lineSelector"
validator="#{packageLine.validateLineSelection}"
value="#{packageLine.selectedLine}"
binding="#{packageLine.oneMenu}">
<f:selectItems value="#{packageLine.productionLineItems}" />
</t:selectOneMenu>
</t:column>
The selectOneMenu is declared as:
import org.apache.myfaces.component.html.ext.HtmlSelectOneMenu;
private HtmlSelectOneMenu oneMenu;
public HtmlSelectOneMenu getOneMenu() {
return oneMenu;
}
public void setOneMenu(HtmlSelectOneMenu oneMenu) {
this.oneMenu = oneMenu;
}
And heres the validation method:
public void validateLineSelection(FacesContext context, UIComponent
component,
Object value) {
logger.info(getOneMenu());
}
The problem is, that the oneMenu Object is null. I need access to each
SelectOneMenu object of the table, because I have to check the selected
client values.
Any hints what I have done wrong?
Heiko
Simon Kitching wrote:
[EMAIL PROTECTED] wrote:
Hi, I have a t:selectOneMenu in a t:dataTable. The dataTable consists
of wrappers, which has the selectOneMenu bound to:
private HtmlSelectOneMenu oneMenu
I want to check for all oneMenu as a double match isn't allowed. To
compare the selected values I must have access to the oneMenu object.
But this is always null. So I can't use the
getOneMenu().getLocalValue() method to access the clients value in
the validator.
Does anybody now what I have done wrong? Or is this a bug in the
dataTable?
I'm having trouble understanding what your setup is. Please post the
relevant fragment of JSP, and any relevant java code.
Cheers, Simon