[ http://issues.apache.org/jira/browse/MYFACES-278?page=comments#action_12371950 ]
Martin Marinschek commented on MYFACES-278: ------------------------------------------- Hi Gillmer, I fixed your problem in closing a second bug - can you please check with the latest sources? I don't find the code you refer to in the sources anymore. regards, Martin > 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