Re: Updating inmethod grid from the server

2010-10-28 Thread Adz

Ah yes, it occurred to me last night that my implementation of equals for my
object must be the problem, thanks for the help.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Updating-inmethod-grid-from-the-server-tp3015007p3018162.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Updating inmethod grid from the server

2010-10-27 Thread Adz

Hi,

I have a requirement whereby I need to periodically poll the db, and refresh
my in method grid if anything has changed.  I've started out by just trying
to get the whole grid to refresh, but I can't seem to get it to work.  I'm
creating my DefaultDataGrid with an implementation of the IDataSource

final DefaultDataGrid tradeDataTable = new DefaultDataGrid(trades,
tradeDataSource, getColumns());

When my onTimer event occurs I go back to the DB, pull out my data and set
it in the tradeDataSource.  I can see that the query method is getting
called again, and it is returning the correct new data, but the grid is not
updating.  I've tried adding combinations of the below, to no avail. 

tradeDataTable.markAllItemsDirty();
tradeDataTable.update();
tradeDataTable.renderComponent();

Does anyone know what i'm doing wrong, or if there is a good example for
using ajax from the server to refresh a DefaultDataGrid.

All help is much appreciated

Adam
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Updating-inmethod-grid-from-the-server-tp3015007p3015007.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Updating inmethod grid from the server

2010-10-27 Thread Adz

I tried that, it didn't make any difference.  I think the problem is due to
the item reuse strategy ReuseIfModelsEqualStrategy.  It has a cache of the
existing items and only compares to see if the new models are in the list of
the old models (which for my case they are), and if they are it uses the old
model, regardless of whether the data in the new model is different.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Updating-inmethod-grid-from-the-server-tp3015007p3016451.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Updating inmethod grid from the server

2010-10-27 Thread Jeremy Thomerson
On Wed, Oct 27, 2010 at 7:00 PM, Adz adam.dar...@three.com.au wrote:


 I tried that, it didn't make any difference.  I think the problem is due to
 the item reuse strategy ReuseIfModelsEqualStrategy.  It has a cache of the
 existing items and only compares to see if the new models are in the list
 of
 the old models (which for my case they are), and if they are it uses the
 old
 model, regardless of whether the data in the new model is different.


Okay, then I believe your problem is one of the following two things:

   1. the objects that your model contains (likely your domain objects) do
   not implement equals and/or hashcode properly
   2. when you created the things in your row items, you didn't use models
   properly, so they have old, stale data in them

Posting code is the only way to get more help.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*