You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Federico Fanton <ff...@ibc.it> on 2008/03/28 12:48:55 UTC
Inspecting AjaxRequestTarget
Hi everyone!
I have an Ajax "editable table" made of rows of custom components similar to AjaxEditableLabel.
It works fairly well, but sometimes I find myself trying to update the whole table alongside a single row (because of business logic).. When this happens, updating the table changes the row, so I get a "No page found for component" exception. My question is: is there a way to inspect/alter the contents of AjaxRequestTarget? If I could do this I'd remove the row from the AJAX update, thus updating only the table and avoiding the problem..
I tried to override WebApplication.newAjaxRequestTarget(), but since every "interesting" method of AjaxRequestTarget is final, I'm stuck :) Maybe it'd be possible to "open" them up a bit to allow customisation?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Inspecting AjaxRequestTarget
Posted by Federico Fanton <ff...@ibc.it>.
On Mon, 31 Mar 2008 09:57:51 +0200
"Johan Compagner" <jc...@gmail.com> wrote:
> done and fixed
And very quickly! Kudos to the Wicket devs!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Inspecting AjaxRequestTarget
Posted by Johan Compagner <jc...@gmail.com>.
done and fixed
On Mon, Mar 31, 2008 at 9:22 AM, Igor Vaynberg <ig...@gmail.com>
wrote:
> you should probably open a jira issue, that way we wont forget about
> it...because i already have
>
> -igor
>
>
> On Mon, Mar 31, 2008 at 12:19 AM, Federico Fanton <ff...@ibc.it> wrote:
> > On Fri, 28 Mar 2008 09:31:39 -0700
> > "Igor Vaynberg" <ig...@gmail.com> wrote:
> >
> > > fine by me
> >
> > Great, I'll keep an eye on SVN then, thanks to everyone :)
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: Inspecting AjaxRequestTarget
Posted by Igor Vaynberg <ig...@gmail.com>.
you should probably open a jira issue, that way we wont forget about
it...because i already have
-igor
On Mon, Mar 31, 2008 at 12:19 AM, Federico Fanton <ff...@ibc.it> wrote:
> On Fri, 28 Mar 2008 09:31:39 -0700
> "Igor Vaynberg" <ig...@gmail.com> wrote:
>
> > fine by me
>
> Great, I'll keep an eye on SVN then, thanks to everyone :)
>
>
>
>
> ---------------------------------------------------------------------
> 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: Inspecting AjaxRequestTarget
Posted by Federico Fanton <ff...@ibc.it>.
On Fri, 28 Mar 2008 09:31:39 -0700
"Igor Vaynberg" <ig...@gmail.com> wrote:
> fine by me
Great, I'll keep an eye on SVN then, thanks to everyone :)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Inspecting AjaxRequestTarget
Posted by Igor Vaynberg <ig...@gmail.com>.
fine by me
-igor
On Fri, Mar 28, 2008 at 6:55 AM, Johan Compagner <jc...@gmail.com> wrote:
> hmm
> So the problem is that AjaxRequestTargets gets a component that is already
> removed
> at the time it wants to render it.
>
> What is the harm in fixing that? That it just ignores such components (maybe
> with a warning in the log)
>
> johan
>
>
>
>
> On Fri, Mar 28, 2008 at 2:07 PM, Federico Fanton <ff...@ibc.it> wrote:
>
> > On Fri, 28 Mar 2008 12:56:44 +0100
> > "Martijn Dashorst" <ma...@gmail.com> wrote:
> >
> > > You could replace the original ajax request target with a new one:
> > >
> > > AjaxRequestTarget newAjax = new AjaxRequestTarget(getPage());
> > > getRequestCycle().setRequestTarget(newAjax);
> > > newAjax.addComponent(table);
> >
> > I see, but I can't confidently replace the target that way, since there
> > could be _other_ components being updated, unrelated to the table.. I'm
> > sorry, I wasn't clear previously :(
> > Would it be a Bad Thing to add a protected
> > AjaxRequestTarget.getMarkupToIdComponents() ?
> > Many thanks for your time!
> >
> >
> > ---------------------------------------------------------------------
> > 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: Inspecting AjaxRequestTarget
Posted by Johan Compagner <jc...@gmail.com>.
hmm
So the problem is that AjaxRequestTargets gets a component that is already
removed
at the time it wants to render it.
What is the harm in fixing that? That it just ignores such components (maybe
with a warning in the log)
johan
On Fri, Mar 28, 2008 at 2:07 PM, Federico Fanton <ff...@ibc.it> wrote:
> On Fri, 28 Mar 2008 12:56:44 +0100
> "Martijn Dashorst" <ma...@gmail.com> wrote:
>
> > You could replace the original ajax request target with a new one:
> >
> > AjaxRequestTarget newAjax = new AjaxRequestTarget(getPage());
> > getRequestCycle().setRequestTarget(newAjax);
> > newAjax.addComponent(table);
>
> I see, but I can't confidently replace the target that way, since there
> could be _other_ components being updated, unrelated to the table.. I'm
> sorry, I wasn't clear previously :(
> Would it be a Bad Thing to add a protected
> AjaxRequestTarget.getMarkupToIdComponents() ?
> Many thanks for your time!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Inspecting AjaxRequestTarget
Posted by Federico Fanton <ff...@ibc.it>.
On Fri, 28 Mar 2008 12:56:44 +0100
"Martijn Dashorst" <ma...@gmail.com> wrote:
> You could replace the original ajax request target with a new one:
>
> AjaxRequestTarget newAjax = new AjaxRequestTarget(getPage());
> getRequestCycle().setRequestTarget(newAjax);
> newAjax.addComponent(table);
I see, but I can't confidently replace the target that way, since there could be _other_ components being updated, unrelated to the table.. I'm sorry, I wasn't clear previously :(
Would it be a Bad Thing to add a protected AjaxRequestTarget.getMarkupToIdComponents() ?
Many thanks for your time!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Inspecting AjaxRequestTarget
Posted by Martijn Dashorst <ma...@gmail.com>.
You could replace the original ajax request target with a new one:
AjaxRequestTarget newAjax = new AjaxRequestTarget(getPage());
getRequestCycle().setRequestTarget(newAjax);
newAjax.addComponent(table);
Martijn
On 3/28/08, Federico Fanton <ff...@ibc.it> wrote:
> Hi everyone!
> I have an Ajax "editable table" made of rows of custom components similar to AjaxEditableLabel.
> It works fairly well, but sometimes I find myself trying to update the whole table alongside a single row (because of business logic).. When this happens, updating the table changes the row, so I get a "No page found for component" exception. My question is: is there a way to inspect/alter the contents of AjaxRequestTarget? If I could do this I'd remove the row from the AJAX update, thus updating only the table and avoiding the problem..
> I tried to override WebApplication.newAjaxRequestTarget(), but since every "interesting" method of AjaxRequestTarget is final, I'm stuck :) Maybe it'd be possible to "open" them up a bit to allow customisation?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org