Re: Wicket Atmosphere jQuery noConflict
Fixed with https://issues.apache.org/jira/browse/WICKET-5917 Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Jun 3, 2015 at 5:06 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, On Wed, Jun 3, 2015 at 4:32 PM, mashleyttu mash...@gmail.com wrote: Our application uses jQuery.noConflict changing all references from $ to $j. We are trying to integrate Wicket Atmosphere into our application, however, are running into an issue where it is rendering a $ in an OnDomReadyHeaderItem.forScript. This is of course causing javascript errors. We have tracked it down to the renderHead method of AtmosphereBehavior. The $ is hard coded in the javascript string. Does anyone know if it is possible to extend AtmosphereBehavior and have Wicket Atmosphere use our custom version? Nope See https://github.com/apache/wicket/blob/2f0d08d4179af272e1670084ec2e36f58628ff13/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereEventSubscriptionCollector.java#L117 Or it is possible to extend OnDomReadyHeaderItem which would do a replace on $( with $j( and have wicket use that globally? There is a way! You can register custom IHeaderResponseDecorator that will re-write the content of OnDomReadyHeaderItem when its script contains $(. See http://wicketinaction.com/2012/07/wicket-6-resource-management/ https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/3e6952567976302ed0698de1b52508fc7747e001/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/WicketApplication.java#L139 https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/3e6952567976302ed0698de1b52508fc7747e001/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/RenderJavaScriptToFooterHeaderResponseDecorator.java#L81 https://github.com/apache/wicket/blob/2f0d08d4179af272e1670084ec2e36f58628ff13/wicket-core/src/main/java/org/apache/wicket/markup/head/filter/FilteringHeaderResponse.java#L172 Here you have to do: @Override public void render(HeaderItem item) { if (item instanceof ondomreadyitem ondomreadyitem.getScript().contains($()) {super.render(OnDomReadyHeaderItem.forScript(item.getScript().replaceAll($(, jQuery()))} Any thoughts on how to resolve this issue? Using Wicket Atmosphere .18 and Wicket 6.11 currently. Please file a ticket so this is fixed for 6.20. Thanks! Thanks, Matt -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Atmosphere-jQuery-noConflict-tp4671046.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Atmosphere jQuery noConflict
Hi, On Wed, Jun 3, 2015 at 4:32 PM, mashleyttu mash...@gmail.com wrote: Our application uses jQuery.noConflict changing all references from $ to $j. We are trying to integrate Wicket Atmosphere into our application, however, are running into an issue where it is rendering a $ in an OnDomReadyHeaderItem.forScript. This is of course causing javascript errors. We have tracked it down to the renderHead method of AtmosphereBehavior. The $ is hard coded in the javascript string. Does anyone know if it is possible to extend AtmosphereBehavior and have Wicket Atmosphere use our custom version? Nope See https://github.com/apache/wicket/blob/2f0d08d4179af272e1670084ec2e36f58628ff13/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereEventSubscriptionCollector.java#L117 Or it is possible to extend OnDomReadyHeaderItem which would do a replace on $( with $j( and have wicket use that globally? There is a way! You can register custom IHeaderResponseDecorator that will re-write the content of OnDomReadyHeaderItem when its script contains $(. See http://wicketinaction.com/2012/07/wicket-6-resource-management/ https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/3e6952567976302ed0698de1b52508fc7747e001/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/WicketApplication.java#L139 https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/3e6952567976302ed0698de1b52508fc7747e001/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/RenderJavaScriptToFooterHeaderResponseDecorator.java#L81 https://github.com/apache/wicket/blob/2f0d08d4179af272e1670084ec2e36f58628ff13/wicket-core/src/main/java/org/apache/wicket/markup/head/filter/FilteringHeaderResponse.java#L172 Here you have to do: @Override public void render(HeaderItem item) { if (item instanceof ondomreadyitem ondomreadyitem.getScript().contains($()) {super.render(OnDomReadyHeaderItem.forScript(item.getScript().replaceAll($(, jQuery()))} Any thoughts on how to resolve this issue? Using Wicket Atmosphere .18 and Wicket 6.11 currently. Please file a ticket so this is fixed for 6.20. Thanks! Thanks, Matt -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Atmosphere-jQuery-noConflict-tp4671046.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Atmosphere jQuery noConflict
Our application uses jQuery.noConflict changing all references from $ to $j. We are trying to integrate Wicket Atmosphere into our application, however, are running into an issue where it is rendering a $ in an OnDomReadyHeaderItem.forScript. This is of course causing javascript errors. We have tracked it down to the renderHead method of AtmosphereBehavior. The $ is hard coded in the javascript string. Does anyone know if it is possible to extend AtmosphereBehavior and have Wicket Atmosphere use our custom version? Or it is possible to extend OnDomReadyHeaderItem which would do a replace on $( with $j( and have wicket use that globally? Any thoughts on how to resolve this issue? Using Wicket Atmosphere .18 and Wicket 6.11 currently. Thanks, Matt -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Atmosphere-jQuery-noConflict-tp4671046.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panels not refreshing when calling AjaxRequestTarget.add(), only in production mode
Hi Sven, Thank you for your reply. Yes, I call formComponentPanel#setOutputMarkupPlaceholderTag(true) on all elements involved with the AjaxRequestTarget. I'm still trying to get to the bottom of this. What I am baffled about is why it doesn't work on production mode when it works without any problems in development mode. when on production mode, on firebug, I get the following error: *Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id [[id29]] was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update.* I have called setOutputMarkupPlaceholderTag(true) on the panel I am adding to AjaxRequestTarget. So the question is, has anyone experienced that a panel is refreshed when running a wicket app in development mode, and that the panel is not refreshed when running a wicket app in production mode? Thanks, once more, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panels-not-refreshing-when-calling-AjaxRequestTarget-add-only-in-production-mode-tp4671035p4671041.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panels not refreshing when calling AjaxRequestTarget.add(), only in production mode
Usually you should use a div. If you know that this component cannot have children with block HTML elements then you can use span too. Read about block vs inline HTML elements in the web. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Jun 3, 2015 at 3:55 PM, lucast lucastol...@hotmail.com wrote: Hi Martin, Thank you for your reply. Yes, you're absolutely right. I use: *wicket:container wicket:id=emptyPanel /* and it is pretty much how I add panels in the HTML code. What should I use instead, div, span, anything else? Thank you very much for pointing this out. I have been racking my brain for almost 5 days in total!!! Kind regards, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panels-not-refreshing-when-calling-AjaxRequestTarget-add-only-in-production-mode-tp4671035p4671044.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panels not refreshing when calling AjaxRequestTarget.add(), only in production mode
Hi Martin, Thank you for your reply. Yes, you're absolutely right. I use: *wicket:container wicket:id=emptyPanel /* and it is pretty much how I add panels in the HTML code. What should I use instead, div, span, anything else? Thank you very much for pointing this out. I have been racking my brain for almost 5 days in total!!! Kind regards, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panels-not-refreshing-when-calling-AjaxRequestTarget-add-only-in-production-mode-tp4671035p4671044.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panels not refreshing when calling AjaxRequestTarget.add(), only in production mode
My guess is that you use wicket:container wicket:id= for something that you update with Ajax. You should see WARNs in the logs about it even in DEV mode. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Jun 3, 2015 at 3:40 PM, lucast lucastol...@hotmail.com wrote: Hi Sven, Thank you for your reply. Yes, I call formComponentPanel#setOutputMarkupPlaceholderTag(true) on all elements involved with the AjaxRequestTarget. I'm still trying to get to the bottom of this. What I am baffled about is why it doesn't work on production mode when it works without any problems in development mode. when on production mode, on firebug, I get the following error: *Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id [[id29]] was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update.* I have called setOutputMarkupPlaceholderTag(true) on the panel I am adding to AjaxRequestTarget. So the question is, has anyone experienced that a panel is refreshed when running a wicket app in development mode, and that the panel is not refreshed when running a wicket app in production mode? Thanks, once more, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Panels-not-refreshing-when-calling-AjaxRequestTarget-add-only-in-production-mode-tp4671035p4671041.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Atmosphere jQuery noConflict
Sir, you are a gentleman and a scholar for your quick reply with links to excellent examples. Thanks so much. You wicket folks think of a solutions for everything. Love the architecture! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Atmosphere-jQuery-noConflict-tp4671046p4671052.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
editing response in onComponentTag
Please see the following code: private static class RequiredLabel extends SimpleFormComponentLabel { private static final long serialVersionUID = 5132250047993256659L; //private boolean required; FormComponent fc; public RequiredLabel(String id, FormComponent fc) { super(id, fc); //this.required = fc.isRequired(); this.fc = fc; } @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); if (fc.isRequired()) { getResponse().write(*); } else { // ?? how do I remove the previously placed * } } } RequiredLabel is a label that is used with a FormComponent. It is used to put the red asterisk to show that input to the field is required. But what happens is that on an ajax request the red asterisks keep on piling up. And I have a case where the field may be changed to be not required. How do I remove the previosly placed red asterisk? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/editing-response-in-onComponentTag-tp4671062.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org