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

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to