You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andrew Geery <an...@gmail.com> on 2013/03/28 02:54:25 UTC

question about page variable in AjaxRequestHandler

I just wanted to confirm that add(Component...) in AjaxRequestHandler
will only work with (i.e., refresh) components that are on the same
page as the page associated with the AjaxRequestHandler.

I had a case where the content of a ModalWindow was a WebPage.  In the
modal window, there was an AjaxLink where I was trying to update a
component on the underlying page in the onSubmit method using the
AjaxRequestHandler object (not directly, in an event handler on the
underlying page).  However, this didn't work and I noticed that the
AjaxRequestHandler object referred to the WebPage in the modal window,
not the page from which the modal was launched.  If I change from
using a page in the modal to using a panel (and thus the
AjaxRequestHandler.page refers to the underlying page), the underlying
page gets properly updated.

If it is true that an AjaxRequestHandler can only be used to update
components on the page it is associated with, would it make sense to
add a warning to either AjaxjRequestHandler or AbstractAjaxResponse if
a component is added which is not on the page associated with the
AjaxRequestHander or AbstractAjaxResponse?

Thanks
Andrew

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


Re: question about page variable in AjaxRequestHandler

Posted by Andrew Geery <an...@gmail.com>.
Done: https://issues.apache.org/jira/browse/WICKET-5121

Thanks
Andrew

On Thu, Mar 28, 2013 at 4:09 AM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> On Thu, Mar 28, 2013 at 3:54 AM, Andrew Geery <an...@gmail.com>wrote:
>
>> I just wanted to confirm that add(Component...) in AjaxRequestHandler
>> will only work with (i.e., refresh) components that are on the same
>> page as the page associated with the AjaxRequestHandler.
>>
>> I had a case where the content of a ModalWindow was a WebPage.  In the
>> modal window, there was an AjaxLink where I was trying to update a
>> component on the underlying page in the onSubmit method using the
>> AjaxRequestHandler object (not directly, in an event handler on the
>> underlying page).  However, this didn't work and I noticed that the
>> AjaxRequestHandler object referred to the WebPage in the modal window,
>> not the page from which the modal was launched.  If I change from
>> using a page in the modal to using a panel (and thus the
>> AjaxRequestHandler.page refers to the underlying page), the underlying
>> page gets properly updated.
>>
>> If it is true that an AjaxRequestHandler can only be used to update
>> components on the page it is associated with, would it make sense to
>> add a warning to either AjaxjRequestHandler or AbstractAjaxResponse if
>> a component is added which is not on the page associated with the
>> AjaxRequestHander or AbstractAjaxResponse?
>>
>
> Yes, this is true.
> This is not so common issue but yes, we can log a warning if a component
> for re-render is not in the current page.
> Please file a ticket.
>
>
>>
>> Thanks
>> Andrew
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>

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


Re: question about page variable in AjaxRequestHandler

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

On Thu, Mar 28, 2013 at 3:54 AM, Andrew Geery <an...@gmail.com>wrote:

> I just wanted to confirm that add(Component...) in AjaxRequestHandler
> will only work with (i.e., refresh) components that are on the same
> page as the page associated with the AjaxRequestHandler.
>
> I had a case where the content of a ModalWindow was a WebPage.  In the
> modal window, there was an AjaxLink where I was trying to update a
> component on the underlying page in the onSubmit method using the
> AjaxRequestHandler object (not directly, in an event handler on the
> underlying page).  However, this didn't work and I noticed that the
> AjaxRequestHandler object referred to the WebPage in the modal window,
> not the page from which the modal was launched.  If I change from
> using a page in the modal to using a panel (and thus the
> AjaxRequestHandler.page refers to the underlying page), the underlying
> page gets properly updated.
>
> If it is true that an AjaxRequestHandler can only be used to update
> components on the page it is associated with, would it make sense to
> add a warning to either AjaxjRequestHandler or AbstractAjaxResponse if
> a component is added which is not on the page associated with the
> AjaxRequestHander or AbstractAjaxResponse?
>

Yes, this is true.
This is not so common issue but yes, we can log a warning if a component
for re-render is not in the current page.
Please file a ticket.


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


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>