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

Gillmer J. Derge commented on MYFACES-278:
------------------------------------------

This is broken again.  It was fixed at some point, possibly revision 422749 of 
HtmlTableRendererBase, and then re-broken in 428204 when the lines below were 
added.

+           if (last > uiData.getRowCount())
+           {
+               last=uiData.getRowCount();
+           }

If getRowCount() returns -1, which it is allowed to do, then this causes no 
rows to be printed.

> 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
>         Assigned To: 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.
-
You can reply to this email to add a comment to the issue online.

Reply via email to