You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andreas Lüdtke <sa...@t-online.de> on 2010/01/29 18:23:22 UTC

AjaxFallbackDefaultDataTable and delete via ModalWindow

Hi,

I have an AjaxFallbackDefaultDataTable on a page and when I delete a row of
the displayed data, I can't get the DataTable to reload and show the reduced
list. I tried already the following:

- delete the object (row) in the database 
- reload the ISortableDataProvider class I'm using <-- this is actually not
needed, because the object is removed
- AjaxFallbackDefaultDataTable.modelChanged()

If I refresh the browser window I see that one object is missing in the list,
but this way I lose the sorting the user has done.

Am I missing something? How do I bring the AjaxFallbackDefaultDataTable to
reflect the changes?

Andreas


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


Re: AjaxFallbackDefaultDataTable and delete via ModalWindow

Posted by Riyad Kalla <rk...@gmail.com>.
Andreas,

Sorry I think my reply came across confusing -- I'm very green with Wicket,
so I can't help with more complex use-case using
the AjaxFallbackDefaultDataTable -- which is probably the right component to
use.

On Tue, Feb 2, 2010 at 1:20 AM, Andreas Lüdtke <sa...@t-online.de>wrote:

> Riyad,
>
> I saw the stop() method and that would help if I only delete one row. But
> what should I do when the second row on that page is deleted? There is no
> restart() or start() method in the timer. Maybe I'm not aware of a method
> to
> re-enable/re-start the timer.
>
> Ok Riyad, what is smarter than the AjaxFallbackDefaultDataTable in your
> opinion ;-)
>
> Andreas
>
> > -----Original Message-----
> > From: Riyad Kalla [mailto:rkalla@gmail.com]
> > Sent: Monday, February 01, 2010 4:40 PM
> > To: users@wicket.apache.org; sam.luedtke@t-online.de
> > Subject: Re: AjaxFallbackDefaultDataTable and delete via ModalWindow
> >
> > Andreas,
> >
> > I'm glad you nailed down what was going on -- that being
> > said, can you just issue a .stop() on the timer on the first
> > callback? So you get your 1 update, then the timer gets
> > killed off and you are good to go?
> >
> > Don't know that much about the Ajax Data Table, otherwise I
> > would recommend something way smarter :)
> >
> > -R
> >
> >
> > On Sat, Jan 30, 2010 at 2:11 AM, Andreas Lüdtke
> > <sa...@t-online.de> wrote:
> >
> >
> >       Riyad,
> >
> >       it's not a dumb question. I asked that already myself
> > and checked via the
> >       debugger that the object is really deleted. But you've
> > put me on the right
> >       track: I placed a link where I do a
> >       AjaxFallbackDefaultDataTable.modelChanged(); and that
> > did the job. Now I've
> >       added an AbstractAjaxTimerBehavior with a duration of 1
> > second and that is
> >       updating the table after one second.
> >
> >       Now I'm curious: do I generate too much Ajax traffic if
> > that timer is running
> >       every second? I only need it to run once after I
> > changed the model...
> >
> >       Thanks
> >
> >       Andreas
> >
> >
> >       > -----Original Message-----
> >       > From: Riyad Kalla [mailto:rkalla@gmail.com]
> >       > Sent: Friday, January 29, 2010 8:35 PM
> >       > To: users@wicket.apache.org; sam.luedtke@t-online.de
> >       > Subject: Re: AjaxFallbackDefaultDataTable and delete
> > via ModalWindow
> >       >
> >       > Andreas,
> >       >
> >       > This might be a dumb question, but are you sure at the point
> >       > that the page
> >       > reloads and re-renders, the object *has* been erased from the
> >       > database or
> >       > cache you are utilizing? For example, right after you delete,
> >       > if you put in
> >       > some silly/junk code to immediately re-query for that object,
> >       > it comes back
> >       > null right?
> >       >
> >       > I'm sure this is an Ajax/model issue, but 1 time it took me 2
> >       > days trying to
> >       > figure out why something "Wasn't deleting" just to find out
> >       > it was, but my
> >       > cache was deferring the operation to a few seconds later. So
> >       > I figured I'd
> >       > throw that out there just incase.
> >       >
> >       > -R
> >       >
> >       > On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke
> >       > <sa...@t-online.de>wrote:
> >       >
> >       > > Hi,
> >       > >
> >       > > I have an AjaxFallbackDefaultDataTable on a page and when I
> >       > delete a row of
> >       > > the displayed data, I can't get the DataTable to
> > reload and show the
> >       > > reduced
> >       > > list. I tried already the following:
> >       > >
> >       > > - delete the object (row) in the database
> >       > > - reload the ISortableDataProvider class I'm using <-- this
> >       > is actually not
> >       > > needed, because the object is removed
> >       > > - AjaxFallbackDefaultDataTable.modelChanged()
> >       > >
> >       > > If I refresh the browser window I see that one object is
> >       > missing in the
> >       > > list,
> >       > > but this way I lose the sorting the user has done.
> >       > >
> >       > > Am I missing something? How do I bring the
> >       > AjaxFallbackDefaultDataTable to
> >       > > reflect the changes?
> >       > >
> >       > > Andreas
> >       > >
> >       > >
> >       > >
> >       >
> > ---------------------------------------------------------------------
> >       > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >       > > For additional commands, e-mail:
> > users-help@wicket.apache.org
> >       > >
> >       > >
> >       >
> >
> >
> >
> > ---------------------------------------------------------------------
> >       To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >       For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: AjaxFallbackDefaultDataTable and delete via ModalWindow

Posted by Andreas Lüdtke <sa...@t-online.de>.
Riyad,

I saw the stop() method and that would help if I only delete one row. But
what should I do when the second row on that page is deleted? There is no
restart() or start() method in the timer. Maybe I'm not aware of a method to
re-enable/re-start the timer.

Ok Riyad, what is smarter than the AjaxFallbackDefaultDataTable in your
opinion ;-)

Andreas

> -----Original Message-----
> From: Riyad Kalla [mailto:rkalla@gmail.com] 
> Sent: Monday, February 01, 2010 4:40 PM
> To: users@wicket.apache.org; sam.luedtke@t-online.de
> Subject: Re: AjaxFallbackDefaultDataTable and delete via ModalWindow
> 
> Andreas,
> 
> I'm glad you nailed down what was going on -- that being 
> said, can you just issue a .stop() on the timer on the first 
> callback? So you get your 1 update, then the timer gets 
> killed off and you are good to go?
> 
> Don't know that much about the Ajax Data Table, otherwise I 
> would recommend something way smarter :)
> 
> -R
> 
> 
> On Sat, Jan 30, 2010 at 2:11 AM, Andreas Lüdtke 
> <sa...@t-online.de> wrote:
> 
> 
> 	Riyad,
> 	
> 	it's not a dumb question. I asked that already myself 
> and checked via the
> 	debugger that the object is really deleted. But you've 
> put me on the right
> 	track: I placed a link where I do a
> 	AjaxFallbackDefaultDataTable.modelChanged(); and that 
> did the job. Now I've
> 	added an AbstractAjaxTimerBehavior with a duration of 1 
> second and that is
> 	updating the table after one second.
> 	
> 	Now I'm curious: do I generate too much Ajax traffic if 
> that timer is running
> 	every second? I only need it to run once after I 
> changed the model...
> 	
> 	Thanks
> 	
> 	Andreas
> 	
> 
> 	> -----Original Message-----
> 	> From: Riyad Kalla [mailto:rkalla@gmail.com]
> 	> Sent: Friday, January 29, 2010 8:35 PM
> 	> To: users@wicket.apache.org; sam.luedtke@t-online.de
> 	> Subject: Re: AjaxFallbackDefaultDataTable and delete 
> via ModalWindow
> 	>
> 	> Andreas,
> 	>
> 	> This might be a dumb question, but are you sure at the point
> 	> that the page
> 	> reloads and re-renders, the object *has* been erased from the
> 	> database or
> 	> cache you are utilizing? For example, right after you delete,
> 	> if you put in
> 	> some silly/junk code to immediately re-query for that object,
> 	> it comes back
> 	> null right?
> 	>
> 	> I'm sure this is an Ajax/model issue, but 1 time it took me 2
> 	> days trying to
> 	> figure out why something "Wasn't deleting" just to find out
> 	> it was, but my
> 	> cache was deferring the operation to a few seconds later. So
> 	> I figured I'd
> 	> throw that out there just incase.
> 	>
> 	> -R
> 	>
> 	> On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke
> 	> <sa...@t-online.de>wrote:
> 	>
> 	> > Hi,
> 	> >
> 	> > I have an AjaxFallbackDefaultDataTable on a page and when I
> 	> delete a row of
> 	> > the displayed data, I can't get the DataTable to 
> reload and show the
> 	> > reduced
> 	> > list. I tried already the following:
> 	> >
> 	> > - delete the object (row) in the database
> 	> > - reload the ISortableDataProvider class I'm using <-- this
> 	> is actually not
> 	> > needed, because the object is removed
> 	> > - AjaxFallbackDefaultDataTable.modelChanged()
> 	> >
> 	> > If I refresh the browser window I see that one object is
> 	> missing in the
> 	> > list,
> 	> > but this way I lose the sorting the user has done.
> 	> >
> 	> > Am I missing something? How do I bring the
> 	> AjaxFallbackDefaultDataTable to
> 	> > reflect the changes?
> 	> >
> 	> > Andreas
> 	> >
> 	> >
> 	> >
> 	> 
> ---------------------------------------------------------------------
> 	> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> 	> > For additional commands, e-mail: 
> users-help@wicket.apache.org
> 	> >
> 	> >
> 	>
> 	
> 	
> 	
> ---------------------------------------------------------------------
> 	To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> 	For additional commands, e-mail: users-help@wicket.apache.org
> 	
> 	
> 
> 
> 


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


Re: AjaxFallbackDefaultDataTable and delete via ModalWindow

Posted by Riyad Kalla <rk...@gmail.com>.
Andreas,

I'm glad you nailed down what was going on -- that being said, can you just
issue a .stop() on the timer on the first callback? So you get your 1
update, then the timer gets killed off and you are good to go?

Don't know that much about the Ajax Data Table, otherwise I would recommend
something way smarter :)

-R

On Sat, Jan 30, 2010 at 2:11 AM, Andreas Lüdtke <sa...@t-online.de>wrote:

> Riyad,
>
> it's not a dumb question. I asked that already myself and checked via the
> debugger that the object is really deleted. But you've put me on the right
> track: I placed a link where I do a
> AjaxFallbackDefaultDataTable.modelChanged(); and that did the job. Now I've
> added an AbstractAjaxTimerBehavior with a duration of 1 second and that is
> updating the table after one second.
>
> Now I'm curious: do I generate too much Ajax traffic if that timer is
> running
> every second? I only need it to run once after I changed the model...
>
> Thanks
>
> Andreas
>
> > -----Original Message-----
> > From: Riyad Kalla [mailto:rkalla@gmail.com]
> > Sent: Friday, January 29, 2010 8:35 PM
> > To: users@wicket.apache.org; sam.luedtke@t-online.de
> > Subject: Re: AjaxFallbackDefaultDataTable and delete via ModalWindow
> >
> > Andreas,
> >
> > This might be a dumb question, but are you sure at the point
> > that the page
> > reloads and re-renders, the object *has* been erased from the
> > database or
> > cache you are utilizing? For example, right after you delete,
> > if you put in
> > some silly/junk code to immediately re-query for that object,
> > it comes back
> > null right?
> >
> > I'm sure this is an Ajax/model issue, but 1 time it took me 2
> > days trying to
> > figure out why something "Wasn't deleting" just to find out
> > it was, but my
> > cache was deferring the operation to a few seconds later. So
> > I figured I'd
> > throw that out there just incase.
> >
> > -R
> >
> > On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke
> > <sa...@t-online.de>wrote:
> >
> > > Hi,
> > >
> > > I have an AjaxFallbackDefaultDataTable on a page and when I
> > delete a row of
> > > the displayed data, I can't get the DataTable to reload and show the
> > > reduced
> > > list. I tried already the following:
> > >
> > > - delete the object (row) in the database
> > > - reload the ISortableDataProvider class I'm using <-- this
> > is actually not
> > > needed, because the object is removed
> > > - AjaxFallbackDefaultDataTable.modelChanged()
> > >
> > > If I refresh the browser window I see that one object is
> > missing in the
> > > list,
> > > but this way I lose the sorting the user has done.
> > >
> > > Am I missing something? How do I bring the
> > AjaxFallbackDefaultDataTable to
> > > reflect the changes?
> > >
> > > Andreas
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: AjaxFallbackDefaultDataTable and delete via ModalWindow

Posted by Andreas Lüdtke <sa...@t-online.de>.
Riyad,

it's not a dumb question. I asked that already myself and checked via the
debugger that the object is really deleted. But you've put me on the right
track: I placed a link where I do a
AjaxFallbackDefaultDataTable.modelChanged(); and that did the job. Now I've
added an AbstractAjaxTimerBehavior with a duration of 1 second and that is
updating the table after one second.

Now I'm curious: do I generate too much Ajax traffic if that timer is running
every second? I only need it to run once after I changed the model...

Thanks

Andreas

> -----Original Message-----
> From: Riyad Kalla [mailto:rkalla@gmail.com] 
> Sent: Friday, January 29, 2010 8:35 PM
> To: users@wicket.apache.org; sam.luedtke@t-online.de
> Subject: Re: AjaxFallbackDefaultDataTable and delete via ModalWindow
> 
> Andreas,
> 
> This might be a dumb question, but are you sure at the point 
> that the page
> reloads and re-renders, the object *has* been erased from the 
> database or
> cache you are utilizing? For example, right after you delete, 
> if you put in
> some silly/junk code to immediately re-query for that object, 
> it comes back
> null right?
> 
> I'm sure this is an Ajax/model issue, but 1 time it took me 2 
> days trying to
> figure out why something "Wasn't deleting" just to find out 
> it was, but my
> cache was deferring the operation to a few seconds later. So 
> I figured I'd
> throw that out there just incase.
> 
> -R
> 
> On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke 
> <sa...@t-online.de>wrote:
> 
> > Hi,
> >
> > I have an AjaxFallbackDefaultDataTable on a page and when I 
> delete a row of
> > the displayed data, I can't get the DataTable to reload and show the
> > reduced
> > list. I tried already the following:
> >
> > - delete the object (row) in the database
> > - reload the ISortableDataProvider class I'm using <-- this 
> is actually not
> > needed, because the object is removed
> > - AjaxFallbackDefaultDataTable.modelChanged()
> >
> > If I refresh the browser window I see that one object is 
> missing in the
> > list,
> > but this way I lose the sorting the user has done.
> >
> > Am I missing something? How do I bring the 
> AjaxFallbackDefaultDataTable to
> > reflect the changes?
> >
> > Andreas
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 


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


Re: AjaxFallbackDefaultDataTable and delete via ModalWindow

Posted by Riyad Kalla <rk...@gmail.com>.
Andreas,

This might be a dumb question, but are you sure at the point that the page
reloads and re-renders, the object *has* been erased from the database or
cache you are utilizing? For example, right after you delete, if you put in
some silly/junk code to immediately re-query for that object, it comes back
null right?

I'm sure this is an Ajax/model issue, but 1 time it took me 2 days trying to
figure out why something "Wasn't deleting" just to find out it was, but my
cache was deferring the operation to a few seconds later. So I figured I'd
throw that out there just incase.

-R

On Fri, Jan 29, 2010 at 10:23 AM, Andreas Lüdtke <sa...@t-online.de>wrote:

> Hi,
>
> I have an AjaxFallbackDefaultDataTable on a page and when I delete a row of
> the displayed data, I can't get the DataTable to reload and show the
> reduced
> list. I tried already the following:
>
> - delete the object (row) in the database
> - reload the ISortableDataProvider class I'm using <-- this is actually not
> needed, because the object is removed
> - AjaxFallbackDefaultDataTable.modelChanged()
>
> If I refresh the browser window I see that one object is missing in the
> list,
> but this way I lose the sorting the user has done.
>
> Am I missing something? How do I bring the AjaxFallbackDefaultDataTable to
> reflect the changes?
>
> Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>