All,

I just entered a JIRA:

https://issues.apache.org/jira/browse/TAPESTRY-1901

I'm posting the details here in case anyone monitoring the list has the
same issue.  I believe there's a workaround.

I have a grid defined with rowsPerPage = 2. When there are 3 elements in
the GridDataSource, the user clicks the "2" link to display page 2. (So
that there is only one element displaying). The user clicks an action
link that has the following event handler defined: 

    public ListAccount onActionFromDel( Integer prmRId ) { 
        _DAO.delByRId(prmRId); 
        return( _listAccount ); 
    } 

(ListAccount is the current page class). 

As the Grid attempts to re-render itself, it calls getAvailableRows() on
the GridDataSource, and getAvailableRows() correctly returns 2. 

The Grid should automatically go to page 1 since there are only 2 rows
available and rowsPerPage is set to 2. However, instead, the Grid calls
prepare() with firstResult = 2 and lastResult = 1. After this, the Grid
calls getRowValue() with a negative value. 

Note that the problem goes away if I add a line to the event handler: 
    public ListAccount onActionFromDel( Integer prmRId ) { 
        _DAO.delByRId(prmRId); 
        _listAccount._actList.setCurrentPage( 1 ); <------ this line
solves the problem 
        return( _listAccount ); 
    } 

But I don't believe this should be necessary. 

Thanks, 
Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to