Hi,
Most probably you use ModalWindow with a Page. This page has its own
JavaScript 'document' that is completely different than the 'document' of
the parent page. I.e. document.getElementById('someId') will not find the
element.
Using ModalWindow with a Panel as content would work for your use case.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Mon, Jun 15, 2015 at 4:15 AM, Entropy <[email protected]> wrote:
> I have a wicket modal that is used to let the user select from a couple
> options on a popup button. On close, depending on what button they hit on
> the popup, I need to run a javascript event on the calling page as I close
> the window, AND I need to alter a label and ExternalLink on the parent
> page.
>
> But wicket is largely ignoring me. I used target.appendJavascript() to
> invoke the javascript method, yet it never gets invoked. I also
> setOutputMarkupId on the controls I need to update (and their parent
> container in fact), and I added all to the target. I changed their models
> to affect their content. So label.setDefaultModel(new Model("newValue"))
> for example, and for the ExternalLink, I used the same to affect the url,
> and used setBody("newValue") to change the body of the link.
>
> Am I doing to wrong? This is all in response to a button in the modal, so
> I
> thought maybe the target is the wrong target. I saw an example where
> someone used ModalWindow.WindowClosedCallback, and so i moved the logic
> into
> that event, using that target, and still, nothing seems to update on the
> front end.
>
> So I must be doing it wrong. Advice?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-modal-change-the-parent-page-tp4671163.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>