You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Ahmed Ashour (JIRA)" <my...@incubator.apache.org> on 2005/06/09 01:16:41 UTC

[jira] Created: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)
-----------------------------------------------------------------------------------------

         Key: MYFACES-278
         URL: http://issues.apache.org/jira/browse/MYFACES-278
     Project: MyFaces
        Type: Bug
    Versions: Nightly Build    
    Reporter: Ahmed Ashour
    Priority: Minor


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


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Gillmer J. Derge (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-278?page=comments#action_12371897 ] 

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

This isn't really fixed.  As the report indicates, any code that uses getRowCount is suspect.  One particular place where I've noticed a problem is in HtmlTableRendererBase.encodeInnerHtml, near line 130.

        if (last > rowCount)
            last = rowCount;

should be guarded in case rowCount is -1.  Something like:

        if ((rowCount >= 0) && (last > rowCount))
            last = rowCount;

Also, just below that an error is logged if a row is not available.  If rowCount is -1, it's not an error for a row to be unavailable.

> 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


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-278?page=comments#action_12418220 ] 

Torsten Krah commented on MYFACES-278:
--------------------------------------

Is this really fixed in 1.1.0 or 1.1.3?
I still get this bug, according to the description above in 1.1.3 version, posted some help request on the user list yesterday and today and found this report now.

kind regards

Torsten

> 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


[jira] Closed: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-278?page=all ]
     
Martin Marinschek closed MYFACES-278:
-------------------------------------


> UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)
> -----------------------------------------------------------------------------------------
>
>          Key: MYFACES-278
>          URL: http://issues.apache.org/jira/browse/MYFACES-278
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.10m10
>     Reporter: Ahmed Ashour
>     Priority: Minor
>      Fix For: 1.0.10m10

>
> 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


[jira] Reopened: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
     [ 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.


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Gillmer J. Derge (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-278?page=comments#action_12371981 ] 

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

Hey, you're right.  I thought I had already checked the latest source code (1.1.1), but I didn't look at the nightly snapshots or the SVN tree.  That code does look fixed.

I downloaded and installed the latest 1.1.3-SNAPSHOT so I could double check that with my application.  That's not working yet, but I'm going to assume that's a classpath issue where I'm still picking up the old libraries from JBoss.  It obviously ought to fix it once I take the time to get it deployed properly.

This is good, because the ADF Faces table wasn't really working for me either.  It fixed this problem but introduced other issues I wasn't happy with (not bugs; it just wasn't the perfect substitute for me).

Thanks.


> 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


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "paul (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487612 ] 

paul commented on MYFACES-278:
------------------------------

I have also verified that this bug still exists. 

If you are using a javax.sql.rowset.CachedRowSet, you can workaround this bug by extending the ResultSetDataModel and overriding the getRowCount() method to return CachedRowSet.size().  





> 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.


[jira] Resolved: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-278?page=all ]
     
Martin Marinschek resolved MYFACES-278:
---------------------------------------

    Fix Version: Nightly Build
     Resolution: Fixed

Waiting for user feedback.

> UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)
> -----------------------------------------------------------------------------------------
>
>          Key: MYFACES-278
>          URL: http://issues.apache.org/jira/browse/MYFACES-278
>      Project: MyFaces
>         Type: Bug
>     Versions: Nightly Build
>     Reporter: Ahmed Ashour
>     Priority: Minor
>      Fix For: Nightly Build

>
> 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


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ 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


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Gillmer J. Derge (JIRA)" <de...@myfaces.apache.org>.
    [ 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


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Gillmer J. Derge (JIRA)" <de...@myfaces.apache.org>.
    [ 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.


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-278?page=comments#action_12418224 ] 

Torsten Krah commented on MYFACES-278:
--------------------------------------

Sorry - meant tomahawk, not myfaces - so its fixed here but not addressed at tomahawk like said at: http://issues.apache.org/jira/browse/TOMAHAWK-89.

kind regards

> 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


[jira] Commented: (MYFACES-278) UIData does not processColumnChildren() if rowCount() returns -1 (for ResultSetDataModel)

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-278?page=comments#action_12319306 ] 

Martin Marinschek commented on MYFACES-278:
-------------------------------------------

thanks for this patch, should be fixed in SVN head (but only for this code location - get back to us if there is more than one place where this needs to be fixed).

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
>         Type: Bug
>     Versions: Nightly Build
>     Reporter: Ahmed Ashour
>     Priority: Minor
>      Fix For: Nightly Build

>
> 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