-->  Does anyone know where I can find a simple example using the table
component with partial results from a database (i.e.
getCurrentPageRows,getRowCount, etc.)?

Jason,

Sorry I just re-read your post . . . The key part I missed was the
"example" ;)

This is a scrubbed impl of a tableModel we use for a search app.  It
uses a spring proxied bean to access a remote web service.  The search
criteria are encapsulated in a query object.  The query objects support
the same type of pagination args that the getCurrentPageRows() method
provides - starting index and page size.

This class preps the query object and delegates to the remote web
service.

Carlos

public class XxTableModel extends AbstractTableModel {

    private Query query;
    
    public Iterator getCurrentPageRows(int nFirst, int nPageSize,
            ITableColumn objSortColumn, boolean bSortOrder) {

                Query query = getQuery();
                query.setStartingIndex(new Long(nFirst));
                query.setPageSize(new Long(nPageSize));
                query.setOrderDirection(translateSortOrder(bSortOrder));
                
                query.setOrder(
                        (Order) translateColumnSort(objSortColumn));
                

               return getWebService().search(query)).iterator();

    }

    public int getRowCount() {
        

                return getWebService()
                    .getRowCount(getQuery());

    }


    public Query getQuery() {
        return this.query;
    }

    public void setQuery(Query query) {
        this.query = query;
    }




}

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

Reply via email to