You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by am...@worldbank.org on 2005/04/13 03:27:52 UTC

contrib:Table and ITableModel reload problem

Hi,

I use table component and ITableModel from contrib library to display the values
fetched from DB.

.page
<component id="mytable" type="contrib:table">
 <binding name="tablemodel" value="tableModel"/>
</component>

List.java
tableModel not declared as an instance variable.

public ITableModel getTableModel(){
 data = Get values from DB...
 columns = Tablecolumn[]
 ITableModel model = new ITableModel(data, columns);
 return model;
}

On accessing the page for the first time by a PageLink , getTableModel() is
invoked and the values are displayed.Performing a search updates the
tableModel.Again on clicking the pagelink the last searched value appears and is
not reset to listing all the values.
How to reset the data again in the model as getTableModel() is not invoked and
picked from the session.
Tried the NullSessionStateManager but had trouble in maintaining the page state.

Can anyone suggest how to solve the problem with the ITableModel as the data
source with some examples.

 Thanks,
Arun

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


Re: contrib:Table and ITableModel reload problem

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

> How to reset the data again in the model as getTableModel() is not invoked and
> picked from the session.

Please call the reset() method of the Table component -- it will clean 
up everything.

One more thing: the 'source' and 'columns' parameters allow you to use 
Table much more easily, although in some cases the TableModel approach 
gives you more flexibility.


amanivachagam@worldbank.org wrote:

>Hi,
>
>I use table component and ITableModel from contrib library to display the values
>fetched from DB.
>
>.page
><component id="mytable" type="contrib:table">
> <binding name="tablemodel" value="tableModel"/>
></component>
>
>List.java
>tableModel not declared as an instance variable.
>
>public ITableModel getTableModel(){
> data = Get values from DB...
> columns = Tablecolumn[]
> ITableModel model = new ITableModel(data, columns);
> return model;
>}
>
>On accessing the page for the first time by a PageLink , getTableModel() is
>invoked and the values are displayed.Performing a search updates the
>tableModel.Again on clicking the pagelink the last searched value appears and is
>not reset to listing all the values.
>How to reset the data again in the model as getTableModel() is not invoked and
>picked from the session.
>Tried the NullSessionStateManager but had trouble in maintaining the page state.
>
>Can anyone suggest how to solve the problem with the ITableModel as the data
>source with some examples.
>
> Thanks,
>Arun
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>


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