[richfaces-issues] [JBoss JIRA] Created: (RF-7454) Is it correct for ExtendedDataTableRenderer to call getRowCount in doEncodeBegin

Mustafa Var (JIRA) jira-events at lists.jboss.org
Fri Jun 26 07:02:56 EDT 2009


Is it correct for ExtendedDataTableRenderer to call getRowCount in doEncodeBegin
--------------------------------------------------------------------------------

                 Key: RF-7454
                 URL: https://jira.jboss.org/jira/browse/RF-7454
             Project: RichFaces
          Issue Type: Bug
    Affects Versions: 3.3.1
         Environment: JBoss 4.2
            Reporter: Mustafa Var


When I use <rich:extendedDataTable>,ExtendedDataModel and Modifiable for dynamic data gathering 
(I only select data in the range through DB inside ExtendedDataModel's walk() method)
ExtendedDataTableRenderer calls getRowCount inside doEncodeBegin() method and it checks rowCount to print the "No data" as the first row of data table.

But of course my rowCount changes when I filter data through DB(in walk method), 
however getRowCount is called inside doEncodeBegin (it is before calling walk method)
That's why getRowCount returns the previous row count of the dataTable and although I have data in list it sometimes prints "No data" as the first row of data table or vice versa
(do not print "No data" although I have no data in data table)

As a workaround I check the caller of the getRowCount method in my model implementation

	public int getRowCount() {
		if("ExtendedDataTableRenderer.java".equals(Thread.currentThread().getStackTrace()[4].getFileName())
				&& "doEncodeBegin".equals(Thread.currentThread().getStackTrace()[4].getMethodName())){
			return 1;
		}
		return rowCount;
	}

and I do not print "No data" at any time.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list