That's basically true. Basically, I find that passing in Object[] solves about 95% of my use cases, and is simpler to use. But the ITableModel allows for greater flexibility and customizability of the component's
innards.

Robert

Skriloff, Nicholas wrote:

You are correct.  The survey was only about languages.  I made a mistake
am sorry for the confusion. But here is a question I do have. For this question assume that the data passed into a table component
comes from a persistent property-specification, usually initialize in
pageBeginRender.

The contrib table model component accepts the data in many forms. But,
two of them are an object[] or IBasicTableModel.  What is the advantage
of doing one over the other in terms of processing?  It seems that if
your data is  IBasicTableModel then you will only store meta-data but
will hit the database between calls for things like paging. If the you
pass in an object array, then the whole array is stored in memory but
there are less database queries for things like paging. Is this Close?


This code below is taken from TableView.java
// if the source parameter is of type [EMAIL PROTECTED] IBasicTableModel}, // create and return an appropriate wrapper
       if (objSourceValue instanceof IBasicTableModel)
           return new BasicTableModelWrap(
               (IBasicTableModel) objSourceValue,
               objColumnModel,
               objState);

       // otherwise, the source parameter must contain the data to be
displayed
       ITableDataModel objDataModel = null;
       if (objSourceValue instanceof Object[])
           objDataModel = new SimpleListTableDataModel((Object[])
objSourceValue);
       else if (objSourceValue instanceof List)
           objDataModel = new SimpleListTableDataModel((List)
objSourceValue);
       else if (objSourceValue instanceof Collection)
           objDataModel = new SimpleListTableDataModel((Collection)
objSourceValue);
       else if (objSourceValue instanceof Iterator)
           objDataModel = new SimpleListTableDataModel((Iterator)
objSourceValue);




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


-----Original Message-----
From: Dmitry Gusev [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 6:58 PM
To: Tapestry users
Subject: Re: Tapestry not ranked high?

You also couldn't find ASP.NET there. Tapestry is not a programming
language
- it's a web  framework.

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



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

Reply via email to