Re: Update parent component from child component

2009-09-20 Thread Jeremy Thomerson
Well, one piece is to use findParent(SecureWebPage.class) rather than three
getParents  or getPage()

The question is why do you want to refresh the whole page via AJAX?  Doesn't
that sort of defeat the purpose.

Nonetheless, please turn your application from deployment to development
mode and use the ajax debug to debug this.

--
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Sep 16, 2009 at 2:30 PM, Ryan O'Hara  wrote:

> I'm trying to update a parent's, parent's, parent component using AJAX.  I
> tried combing the archives and came up with some seemingly useful stuff (
> http://www.nabble.com/How-to-update-base-page-panel-from-child-page--td20998486.html#a21015568),
> although I'm still have trouble.  Below is a code snippet:
>
> AjaxSubmitLink asl = new AjaxSubmitLink("submitButton") {
>public void onSubmit(AjaxRequestTarget target, Form form) {
>
>  target.addComponent(this.getParent().getParent().getParent());
>}
> };
>
> 'this' is an AjaxSubmitLink
> 1st getParent() is a Form
> 2nd getParent() is a Panel
> 3rd getParent() is a SecureWebPage
>
> I'd like to reload SecureWebPage, so that all of its Panel child components
> (and their child components) are reloaded.  I've tried explicitly calling
> setOutputMarkupId(true) on each Form, Panel, and SecureWebPage component.
>  I've also tried wrapping the Panels with a WebMarkupContainer and updating
> that, but that didn't seem to work either.  Any advice?
>
> Thanks,
> Ryan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Update parent component from child component

2009-09-17 Thread Ernesto Reinaldo Barreiro
I'm not sure you can reload a whole page using AJAX... Why not reload the
containing Panel? Mind that you have to make sure that the panel outputs a
markup ID so that AJAX replacement can work...

Ernesto

On Wed, Sep 16, 2009 at 9:30 PM, Ryan O'Hara  wrote:

> I'm trying to update a parent's, parent's, parent component using AJAX.  I
> tried combing the archives and came up with some seemingly useful stuff (
> http://www.nabble.com/How-to-update-base-page-panel-from-child-page--td20998486.html#a21015568),
> although I'm still have trouble.  Below is a code snippet:
>
> AjaxSubmitLink asl = new AjaxSubmitLink("submitButton") {
>public void onSubmit(AjaxRequestTarget target, Form form) {
>
>  target.addComponent(this.getParent().getParent().getParent());
>}
> };
>
> 'this' is an AjaxSubmitLink
> 1st getParent() is a Form
> 2nd getParent() is a Panel
> 3rd getParent() is a SecureWebPage
>
> I'd like to reload SecureWebPage, so that all of its Panel child components
> (and their child components) are reloaded.  I've tried explicitly calling
> setOutputMarkupId(true) on each Form, Panel, and SecureWebPage component.
>  I've also tried wrapping the Panels with a WebMarkupContainer and updating
> that, but that didn't seem to work either.  Any advice?
>
> Thanks,
> Ryan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Update parent component from child component

2009-09-17 Thread Pedro Santos
See if it work, I don't think you are needing an asynchronous behavior to
your link...

setResponsePage(getPage());


On Wed, Sep 16, 2009 at 4:30 PM, Ryan O'Hara  wrote:

> I'm trying to update a parent's, parent's, parent component using AJAX.  I
> tried combing the archives and came up with some seemingly useful stuff (
> http://www.nabble.com/How-to-update-base-page-panel-from-child-page--td20998486.html#a21015568),
> although I'm still have trouble.  Below is a code snippet:
>
> AjaxSubmitLink asl = new AjaxSubmitLink("submitButton") {
>public void onSubmit(AjaxRequestTarget target, Form form) {
>
>  target.addComponent(this.getParent().getParent().getParent());
>}
> };
>
> 'this' is an AjaxSubmitLink
> 1st getParent() is a Form
> 2nd getParent() is a Panel
> 3rd getParent() is a SecureWebPage
>
> I'd like to reload SecureWebPage, so that all of its Panel child components
> (and their child components) are reloaded.  I've tried explicitly calling
> setOutputMarkupId(true) on each Form, Panel, and SecureWebPage component.
>  I've also tried wrapping the Panels with a WebMarkupContainer and updating
> that, but that didn't seem to work either.  Any advice?
>
> Thanks,
> Ryan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Update parent component from child component

2009-09-17 Thread Ryan O'Hara
I'm trying to update a parent's, parent's, parent component using  
AJAX.  I tried combing the archives and came up with some seemingly  
useful stuff (http://www.nabble.com/How-to-update-base-page-panel-from-child-page--td20998486.html#a21015568 
), although I'm still have trouble.  Below is a code snippet:


AjaxSubmitLink asl = new AjaxSubmitLink("submitButton") {
public void onSubmit(AjaxRequestTarget target, Form form) {
target.addComponent(this.getParent().getParent().getParent());
}
};

'this' is an AjaxSubmitLink
1st getParent() is a Form
2nd getParent() is a Panel
3rd getParent() is a SecureWebPage

I'd like to reload SecureWebPage, so that all of its Panel child  
components (and their child components) are reloaded.  I've tried  
explicitly calling setOutputMarkupId(true) on each Form, Panel, and  
SecureWebPage component.  I've also tried wrapping the Panels with a  
WebMarkupContainer and updating that, but that didn't seem to work  
either.  Any advice?


Thanks,
Ryan

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