You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mathias Nilsson <wi...@gmail.com> on 2014/09/27 14:36:28 UTC

Make wicket aware of loaded javascript

Hi,

I have a javascript function already loaded when the first page loads. When
adding a new Panel thru ajax I add target.appendJavascript afterwards but I
get Exception evaluating javascript: ReferenceError: deselectAll is not
defined. 

I know that the script is there..... I must be missing something. Any
pointers?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Make-wicket-aware-of-loaded-javascript-tp4667733.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Make wicket aware of loaded javascript

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

It should work.
It won't work if the appended JS is executed in a different context, e.g.
inside an iframe (a ModalWindow with a Page).

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, Sep 27, 2014 at 2:36 PM, Mathias Nilsson <
wicket.programmer@gmail.com> wrote:

> Hi,
>
> I have a javascript function already loaded when the first page loads. When
> adding a new Panel thru ajax I add target.appendJavascript afterwards but I
> get Exception evaluating javascript: ReferenceError: deselectAll is not
> defined.
>
> I know that the script is there..... I must be missing something. Any
> pointers?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Make-wicket-aware-of-loaded-javascript-tp4667733.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Make wicket aware of loaded javascript

Posted by Andrea Del Bene <an...@gmail.com>.
Hi,

maybe you are refreshing th dom via AJAX and you loose previously 
defined js functions. What components do you refresh when you add panel 
via AJAX?
> Hi,
>
> I have a javascript function already loaded when the first page loads. When
> adding a new Panel thru ajax I add target.appendJavascript afterwards but I
> get Exception evaluating javascript: ReferenceError: deselectAll is not
> defined.
>
> I know that the script is there..... I must be missing something. Any
> pointers?
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Make-wicket-aware-of-loaded-javascript-tp4667733.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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