Re: Updating an inmethod grid, looking for hints
Sorry, please ignore my previous e-mail. The behavior I saw was due to a DropDownChoice I added to the toolbar. During a submit Wicket verifies whether the ddc is visible. Unfortunately this leads to a call to PagingToolbar.isVisible. Back to square 1. Regards, Erik. On Thu, 23 Jul 2009 05:20:06 -0700 (PDT), Erik van Oosten wrote: > Hi Matej, > > I finally found the bug. > > When you are using a DefaultDataGrid it adds a PagingToolbar. PagingToolbar > overrides isVisible. In isVisible the total row count is determined, this > will cache the query result for this request. However, isVisible is called > /before/ the ajax listener is called. Therefore any changes to the grid > (like rowCount) are not used. > > Regards, > Erik. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating an inmethod grid, looking for hints
Hi Matej, I finally found the bug. When you are using a DefaultDataGrid it adds a PagingToolbar. PagingToolbar overrides isVisible. In isVisible the total row count is determined, this will cache the query result for this request. However, isVisible is called /before/ the ajax listener is called. Therefore any changes to the grid (like rowCount) are not used. Regards, Erik. Erik van Oosten wrote: > > Hi, > > How can I trigger an inmethod grid to do a /complete/ update of itself? > > The only thing that I see is markAllDirty(). That will update the items > currently in the list, but it will /not/ get new items from the data > provider. > > I researched the code for quite some time but I must have been looking > at the wrong parts as I found no hook to get this done. The most I could > do was call detach() on Body, one of the inner classes of a grid. But on > screen, that would only update the number of items in the lower toolbar, > not the items in the grid themselves. > > More ideas? > > Ideally, imho, the grid should respond to modelChanged(). But I have > still no clue what should be in that method. > > Regards, > Erik. > -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ -- View this message in context: http://www.nabble.com/Updating-an-inmethod-grid%2C-looking-for-hints-tp24438566p24624631.html Sent from the Wicket - User 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 an inmethod grid, looking for hints
Hi Matej, I just got a hint from a colleague: it might has something to do with returning the wrong number of items in the dataprovider query. We probably return UNDEFINED too often. I'll look further into it. Regards, Erik. Erik van Oosten wrote: DataGrid. DefaultDataGrid mostly. Erik. Matej Knopp schreef: are you using treegrid or datagrid? -Matej On Sat, Jul 11, 2009 at 1:43 PM, Erik van Oosten wrote: If I remember correctly that only updates the existing items and ignore new items. I am looking for a way to get the new items too. Regards, Erik. -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating an inmethod grid, looking for hints
DataGrid. DefaultDataGrid mostly. Erik. Matej Knopp schreef: are you using treegrid or datagrid? -Matej On Sat, Jul 11, 2009 at 1:43 PM, Erik van Oosten wrote: If I remember correctly that only updates the existing items and ignore new items. I am looking for a way to get the new items too. Regards, Erik. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating an inmethod grid, looking for hints
are you using treegrid or datagrid? -Matej On Sat, Jul 11, 2009 at 1:43 PM, Erik van Oosten wrote: > If I remember correctly that only updates the existing items and ignore new > items. I am looking for a way to get the new items too. > > Regards, > Erik. > > > Matej Knopp wrote: >> >> You need to call the update() method during an ajax request after you >> have marked the items dirty. >> >> -Matej >> >> On Sat, Jul 11, 2009 at 11:01 AM, Erik van Oosten >> wrote: >> >>> >>> Hi, >>> >>> How can I trigger an inmethod grid to do a /complete/ update of itself? >>> >>> The only thing that I see is markAllDirty(). That will update the items >>> currently in the list, but it will /not/ get new items from the data >>> provider. >>> >>> I researched the code for quite some time but I must have been looking at >>> the wrong parts as I found no hook to get this done. The most I could do >>> was >>> call detach() on Body, one of the inner classes of a grid. But on screen, >>> that would only update the number of items in the lower toolbar, not the >>> items in the grid themselves. >>> >>> More ideas? >>> >>> Ideally, imho, the grid should respond to modelChanged(). But I have >>> still >>> no clue what should be in that method. >>> >>> Regards, >>> Erik. >>> >>> >>> -- >>> Erik van Oosten >>> http://www.day-to-day-stuff.blogspot.com/ >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating an inmethod grid, looking for hints
If I remember correctly that only updates the existing items and ignore new items. I am looking for a way to get the new items too. Regards, Erik. Matej Knopp wrote: You need to call the update() method during an ajax request after you have marked the items dirty. -Matej On Sat, Jul 11, 2009 at 11:01 AM, Erik van Oosten wrote: Hi, How can I trigger an inmethod grid to do a /complete/ update of itself? The only thing that I see is markAllDirty(). That will update the items currently in the list, but it will /not/ get new items from the data provider. I researched the code for quite some time but I must have been looking at the wrong parts as I found no hook to get this done. The most I could do was call detach() on Body, one of the inner classes of a grid. But on screen, that would only update the number of items in the lower toolbar, not the items in the grid themselves. More ideas? Ideally, imho, the grid should respond to modelChanged(). But I have still no clue what should be in that method. Regards, Erik. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating an inmethod grid, looking for hints
You need to call the update() method during an ajax request after you have marked the items dirty. -Matej On Sat, Jul 11, 2009 at 11:01 AM, Erik van Oosten wrote: > Hi, > > How can I trigger an inmethod grid to do a /complete/ update of itself? > > The only thing that I see is markAllDirty(). That will update the items > currently in the list, but it will /not/ get new items from the data > provider. > > I researched the code for quite some time but I must have been looking at > the wrong parts as I found no hook to get this done. The most I could do was > call detach() on Body, one of the inner classes of a grid. But on screen, > that would only update the number of items in the lower toolbar, not the > items in the grid themselves. > > More ideas? > > Ideally, imho, the grid should respond to modelChanged(). But I have still > no clue what should be in that method. > > Regards, > Erik. > > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org