Hi,
If you use ModalWindow based on a Page then you have to keep a reference to
that page by using openerPage.getPageReference().
Later when you need to update the opener page you have to use
"pageRef.getPage()".
You can see
https://github.com/apache/wicket/blob/686058119dd795b3de7f2016e3e64fb8f025f813/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/modal/ModalContent1Page.java
for example.
The problem in your case is that the opener's instance of MyTextFieldPanel
is serialized when the modal window's page is opened. Later when you close
the modal it works on the old version, not the latest one that is
deserialized with the opener page.
If you use ModalWindow with a Panel then there is no such issue.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Mon, Apr 11, 2016 at 10:42 PM, durairaj t wrote:
> Hi,
>
>
>
> I'm using "*new* ModalWindow.WindowClosedCallback(){}" to update the
> modified value in a text field box by invoking the * target.add(*
> *MyTextFieldPanel.this**)*, but it is always giving the old values.
>
>
> I'm seeing only old values in *MyTextFieldPanel.this. *
>
>
> Code snippet for a clear picture.
>
>
> public class AimShuttleTextFieldPanel extends Panel
>
>
> modalShuttleWindow.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback() {
>
> public void onClose(AjaxRequestTarget target) {
>
> target.add(*MyTextFieldPanel.this*);
>
> onWindowClose(target);
>
> }
>
> });
>
>
> Any help?
>
>
>
> Thanks,
>