[
https://jira.jboss.org/jira/browse/RF-4240?page=com.atlassian.jira.plugin...
]
Zied Hamdi commented on RF-4240:
--------------------------------
I encountred the same problem when my object was an array: someId1 for your case
You'd rather use objects
rich:scrollableDataTable exception thrown when attempting to filter
-------------------------------------------------------------------
Key: RF-4240
URL:
https://jira.jboss.org/jira/browse/RF-4240
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.2.2
Environment: FireFox 3.0, JSF 1.2, RichFaces 3.2.1
Reporter: Valery Tcherepanov
Assignee: Konstantin Mishin
Fix For: Future
rich:scrollableDataTable fallbacks to rich:column id attribute as part of expression by
which to filter. Since id attribute is not intended(??) to be a part of any type of value
expression that may lead to unexpected sorting results or exception thrown. See code
example below
// bean
import java.util.List;
import java.util.ArrayList;
public class TableBean {
private List<String[]> tableData;
private String[] headers;
public TableBean() {
fillTableData();
fillHeaders();
}
private void fillHeaders() {
headers = new String[]{"Header1", "Header2"};
}
private void fillTableData() {
tableData = new ArrayList<String[]>();
for (int i = 0; i < 20; i++) {
tableData.add(new String[]{"Record " + i, i + ""});
}
}
public List<String[]> getTableData() {
return tableData;
}
public String[] getHeaders() {
return headers;
}
}
// table
<rich:scrollableDataTable
height="400px"
width="700px"
value="#{tableBean.tableData}"
var="data">
<rich:column id="someId0">
<f:facet name="header"><h:outputText
value="#{tableBean.headers[0]}"/></f:facet>
<h:outputText value="#{data[0]}"/>
</rich:column>
<rich:column id="someId1">
<f:facet name="header"><h:outputText
value="#{tableBean.headers[1]}"/></f:facet>
<h:outputText value="#{data[1]}"/>
</rich:column>
</rich:scrollableDataTable>
Clicking on table header (in FireFox) results in
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling
this request.
exception
javax.servlet.ServletException: For input string: "someId1"
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
root cause
java.lang.NumberFormatException: For input string: "someId1"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
java.lang.Integer.parseInt(Integer.java:447)
java.lang.Integer.parseInt(Integer.java:497)
javax.el.ArrayELResolver.coerce(ArrayELResolver.java:153)
javax.el.ArrayELResolver.getValue(ArrayELResolver.java:45)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
org.richfaces.model.impl.expressive.SimplePropertyExpression.evaluate(SimplePropertyExpression.java:33)
org.richfaces.model.impl.expressive.ObjectWrapperFactory.wrapObject(ObjectWrapperFactory.java:189)
org.richfaces.model.impl.expressive.ObjectWrapperFactory$2.convert(ObjectWrapperFactory.java:177)
org.richfaces.model.impl.expressive.ObjectWrapperFactory.convertList(ObjectWrapperFactory.java:138)
org.richfaces.model.impl.expressive.ObjectWrapperFactory.wrapList(ObjectWrapperFactory.java:175)
org.richfaces.model.internal.ComponentSortableDataModel.prepareCollection(ComponentSortableDataModel.java:58)
org.richfaces.model.internal.ComponentSortableDataModel.loadData(ComponentSortableDataModel.java:112)
org.richfaces.model.DataModelCache.loadData(DataModelCache.java:153)
org.richfaces.model.ScrollableTableDataModel.walk(ScrollableTableDataModel.java:127)
org.richfaces.model.DataModelCache.walk(DataModelCache.java:183)
org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:1127)
org.richfaces.component.UIScrollableDataTable.walk(UIScrollableDataTable.java:347)
org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.renderAjaxChildren(ScrollableDataTableBaseRenderer.java:736)
org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.encodeChildren(ScrollableDataTableBaseRenderer.java:804)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:125)
org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:68)
org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:116)
org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:68)
org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:116)
org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:673)
org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:544)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira