[ 
https://issues.apache.org/jira/browse/MYFACES-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Marinschek reopened MYFACES-278:
---------------------------------------

      Assignee:     (was: Martin Marinschek)

> UIData does not processColumnChildren() if rowCount() returns -1 (for 
> ResultSetDataModel)
> -----------------------------------------------------------------------------------------
>
>                 Key: MYFACES-278
>                 URL: https://issues.apache.org/jira/browse/MYFACES-278
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Ahmed Ashour
>            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.
-
You can reply to this email to add a comment to the issue online.

Reply via email to