You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nima Boustanian <ni...@tn20.com> on 2006/03/15 17:38:39 UTC

[Newbie] IBasicTableModel

Hey list people

I am trying to implement a IBasicTableModel and this is what I have so far:

MyTable.java
public class MyTable implements Serializable {
   
    private static final long serialVersionUID = -1345425240124508L;
   
    private String title;
   
    public ConversationsPlaceHolderTable() {}
   
    public ConversationsPlaceHolderTable(String title) {
        this.title = title;
    }
   
    public String getTitle() {
        return title;
    }
   
    public int getRowCount() {
        return 20;
    }
   
    public Iterator getCurrentPageRows(int firstRow, int rowsPerPage,
        ITableColumn sortColumn, boolean sortOrder) {
        List result = new ArrayList();
        result.add("hej");
        result.add("test");
        return result.iterator();
    }

}

And the HTML:
<table jwcid="table@contrib:Table"
                                    source="ognl:new test.tables.MyTable()"
                                    columns="Test"
                                    pageSize="10"
                                    pagesDisplayed="5"/>
</table>

But I keep getting this error:
Error at context:/WEB-INF/jwc/PlaceHolder.jwc, line 6, column 112: 
Method 'public abstract java.util.Iterator 
org.apache.tapestry.contrib.table.model.IBasicTableModel.getCurrentPageRows(int,int,org.apache.tapestry.contrib.table.model.ITableColumn,boolean)' 
has no implementation in class test.tables.MyTable (or enhanced subclass 
$ConversationsPlaceHolder_17).

Do I need to declare the table somewhere in a page or jwc file?

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: [Newbie] IBasicTableModel

Posted by Kent Tong <ke...@cpttm.org.mo>.
Nima Boustanian <nima <at> tn20.com> writes:

> I am trying to implement a IBasicTableModel and this is what I have so far:
> 
> MyTable.java
> public class MyTable implements Serializable {

Try:

 public class MyTable implements Serializable, IBasicTableModel  {
   ...
 }

--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org