You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alexey Mukas <al...@gmail.com> on 2013/04/12 10:41:08 UTC
Generating wrong JavaScript on ajax updated
Hi,
Suppose I have BlinkBehaviour
public static class BlinkBehaviour extends Behavior {
@Override
public void renderHead(Component component, IHeaderResponse
response) {
AjaxRequestTarget target =
component.getRequestCycle().find(AjaxRequestTarget.class);
if (target != null) {
target.prependJavaScript("notify|jQuery('#" +
component.getMarkupId() + "').fadeOut(400, notify);");
target.appendJavaScript("jQuery('#"+component.getMarkupId()+"').fadeIn(400);");
}
}
}
If I add it twice to a control and update the control via ajax
6.7.0-SNAPSHOT will yield error:
ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript:
SyntaxError: Unexpected token ), text: f = function(notify)
{jQuery('#version2').fadeOut(400,
notify);})();(function(){notify|jQuery('#version2').fadeOut(400, notify);};
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generating-wrong-JavaScript-on-ajax-updated-tp4657921.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: Generating wrong JavaScript on ajax updated
Posted by Alexey Mukas <al...@gmail.com>.
Here is a ticker with a quick start WICKET-5142
<https://issues.apache.org/jira/browse/WICKET-5142>
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generating-wrong-JavaScript-on-ajax-updated-tp4657921p4657923.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: Generating wrong JavaScript on ajax updated
Posted by Martin Grigorov <mg...@apache.org>.
Ticket please! :-)
I'm not sure I'll be able to improve that for 6.7.0 though. It has to be
cut anytime now.
On Fri, Apr 12, 2013 at 11:41 AM, Alexey Mukas <al...@gmail.com>wrote:
> Hi,
>
> Suppose I have BlinkBehaviour
>
> public static class BlinkBehaviour extends Behavior {
> @Override
> public void renderHead(Component component, IHeaderResponse
> response) {
> AjaxRequestTarget target =
> component.getRequestCycle().find(AjaxRequestTarget.class);
> if (target != null) {
> target.prependJavaScript("notify|jQuery('#" +
> component.getMarkupId() + "').fadeOut(400, notify);");
>
>
> target.appendJavaScript("jQuery('#"+component.getMarkupId()+"').fadeIn(400);");
> }
> }
> }
>
> If I add it twice to a control and update the control via ajax
> 6.7.0-SNAPSHOT will yield error:
>
> ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript:
> SyntaxError: Unexpected token ), text: f = function(notify)
> {jQuery('#version2').fadeOut(400,
> notify);})();(function(){notify|jQuery('#version2').fadeOut(400, notify);};
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Generating-wrong-JavaScript-on-ajax-updated-tp4657921.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
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>