I'm trying to use the IceFaces (+ Seam 3 Framework on Jboss AS7) "ice:rowSelector" tag in a way that when a dataTable's row is cliked, the data in that row will be show in a "ice:panelGrid" tag with "ice:outputLabel"s.
I'm setting the clickListener as in some examples around, like this:
<ice:rowSelector immediate="true" clickListener="#{categoryController.selectionListener}"/>
the method is:
public void selectionListener(ClickActionEvent clickActionEvent) {
selectedCategory= categories.get(clickActionEvent.getRow());
}
being "categories"
List<Category> categories
But when I test the app, I get a javax.el.MethodNotFoundException exception. Then I add the "()"s to the method call (clickListener="#{categoryController.selectionListener()}"), getting the same exception.
Finally, I set clickListener="#{categoryController.selectionListener(clickActionEvent)}" and the method is called BUT "clickActionEvent" makes it throw NullPointException. The relevant part is:
Caused by: javax.el.ELException: /showCategory.xhtml @20,114 clickListener="#{categoryController.selectionListener(clickActionEvent)}": java.lang.NullPointerException
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.icesoft.faces.component.facelets.MethodExpressionMethodBinding.invoke(IceComponentHandler.java:231) [icefaces-compat-3.0.1.jar:]
at com.icesoft.faces.component.ext.RowSelector.broadcast(RowSelector.java:530) [icefaces-compat-3.0.1.jar:]
at org.icefaces.impl.component.UISeriesBase.broadcast(UISeriesBase.java:481) [icefaces-3.0.1.jar:]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:935) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) [jsf-impl-2.1.7-jbossorg-2.jar:]
... 29 more
Caused by: java.lang.NullPointerException
My question is: what should I pass as ClickActionEvent parameter to the "selectionListener" method?
what should I pass as ClickActionEvent parameter to the "selectionListener" method?
Pass RowSelectorEvent.