[ http://issues.apache.org/jira/browse/MYFACES-278?page=comments#action_12371898 ]
Gillmer J. Derge commented on MYFACES-278: ------------------------------------------ I'm also not sure "Minor" is the right priority for this. Although it does appear to be somewhat obscure (since nobody reported it earlier), it's a clear violation of the spec. The description of the rowCount property of UIData reads, "The number of rows in the underlying DataModel, which can be -1 if the number of rows is unknown." MyFaces isn't correctly handling that case where it's -1. > UIData does not processColumnChildren() if rowCount() returns -1 (for > ResultSetDataModel) > ----------------------------------------------------------------------------------------- > > Key: MYFACES-278 > URL: http://issues.apache.org/jira/browse/MYFACES-278 > Project: MyFaces Core > Type: Bug > Versions: 1.1.0 > Reporter: Ahmed Ashour > Assignee: Martin Marinschek > Priority: Minor > Fix For: 1.1.0 > > Any code that iterates the rows using getRowCount() would fail, because it > might be -1 (for ResultSetDataModel). > Instead, isRowAvailable() should be used to iterator over the rows, and > "break" otherwise. > E.g. in javax.faces.component.UIData > private void processColumnChildren(FacesContext context, int processAction) { > int first = getFirst(); > int rows = getRows(); > int last; > if (rows == 0) { > last = getRowCount(); > } else { > last = first + rows; > } > for (int rowIndex = first; rowIndex < last; rowIndex++) { > setRowIndex(rowIndex); > if (isRowAvailable()) { > Should be replaced with > private void processColumnChildren(FacesContext context, int processAction) { > int first = getFirst(); > int rows = getRows(); > int last; > if (rows == 0) { > last = getRowCount(); > } else { > last = first + rows; > } > for (int rowIndex = first; last==-1 || rowIndex < last; > rowIndex++) { > setRowIndex(rowIndex); > if (isRowAvailable()) { > } else > break -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira