Re: gmap2, wicket 6.9 and ajax refresh
Hi, https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java?source=cc doesn't cut the 'on' prefix. https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java?source=cc#L68 - does. I'll update OnEventHeaderItem to do it too. Explanation: 'onclick' should be used for inline attributes, e.g. div onclick=... ... 'click' should be used for document.addEventListener/attachEvent On Wed, Jul 31, 2013 at 10:17 PM, Cedric Gatay gata...@gmail.com wrote: If I remember well click or on click should work, the on prefix is automatically removed if it is present. Regards, Le 31 juil. 2013 20:47, Gabriel Landon glan...@piti.pf a écrit : Martin in the javadoc there's an example saying onclick. So should it be click? /** * Creates a {@link OnEventHeaderItem} for the given parameters. * * @param target *The target of the event handler, for example 'window' or 'document'. * @param event *The event itself, for example '*onclick*'. * @param javaScript *The script to execute on the event. * * @return A newly created {@link OnEventHeaderItem}. */ public static OnEventHeaderItem forScript(String target, String event, CharSequence javaScript) { return new OnEventHeaderItem(target, event, javaScript); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660586.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: gmap2, wicket 6.9 and ajax refresh
https://issues.apache.org/jira/browse/WICKET-5296 On Thu, Aug 1, 2013 at 8:52 AM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java?source=cc doesn't cut the 'on' prefix. https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java?source=cc#L68 - does. I'll update OnEventHeaderItem to do it too. Explanation: 'onclick' should be used for inline attributes, e.g. div onclick=... ... 'click' should be used for document.addEventListener/attachEvent On Wed, Jul 31, 2013 at 10:17 PM, Cedric Gatay gata...@gmail.com wrote: If I remember well click or on click should work, the on prefix is automatically removed if it is present. Regards, Le 31 juil. 2013 20:47, Gabriel Landon glan...@piti.pf a écrit : Martin in the javadoc there's an example saying onclick. So should it be click? /** * Creates a {@link OnEventHeaderItem} for the given parameters. * * @param target *The target of the event handler, for example 'window' or 'document'. * @param event *The event itself, for example '*onclick*'. * @param javaScript *The script to execute on the event. * * @return A newly created {@link OnEventHeaderItem}. */ public static OnEventHeaderItem forScript(String target, String event, CharSequence javaScript) { return new OnEventHeaderItem(target, event, javaScript); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660586.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: gmap2, wicket 6.9 and ajax refresh
Looking at the code on my phone is not that easy, i had a wrong souvenir ;) __ Cedric Gatay (@Cedric_Gatay http://twitter.com/Cedric_Gatay) http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr On Thu, Aug 1, 2013 at 9:04 AM, Martin Grigorov mgrigo...@apache.orgwrote: https://issues.apache.org/jira/browse/WICKET-5296 On Thu, Aug 1, 2013 at 8:52 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/head/OnEventHeaderItem.java?source=ccdoesn't cut the 'on' prefix. https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java?source=cc#L68- does. I'll update OnEventHeaderItem to do it too. Explanation: 'onclick' should be used for inline attributes, e.g. div onclick=... ... 'click' should be used for document.addEventListener/attachEvent On Wed, Jul 31, 2013 at 10:17 PM, Cedric Gatay gata...@gmail.com wrote: If I remember well click or on click should work, the on prefix is automatically removed if it is present. Regards, Le 31 juil. 2013 20:47, Gabriel Landon glan...@piti.pf a écrit : Martin in the javadoc there's an example saying onclick. So should it be click? /** * Creates a {@link OnEventHeaderItem} for the given parameters. * * @param target *The target of the event handler, for example 'window' or 'document'. * @param event *The event itself, for example '*onclick*'. * @param javaScript *The script to execute on the event. * * @return A newly created {@link OnEventHeaderItem}. */ public static OnEventHeaderItem forScript(String target, String event, CharSequence javaScript) { return new OnEventHeaderItem(target, event, javaScript); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660586.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: gmap2, wicket 6.9 and ajax refresh
Thank you for you help Martin. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660630.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: gmap2, wicket 6.9 and ajax refresh
Hi, Yes, as you have found there is a ticket about this. On Wed, Jul 31, 2013 at 12:55 AM, Gabriel Landon glan...@piti.pf wrote: Since I've upgrade from wicket 6.8.0 to wicket 6.9.1, many of my gmap panel are not working anymore when I do an ajax refresh on them. From what's I've discovered is that on the refresh the Wicket.Event.add(window, onUnload, function(event) { google.maps.Unload();;}); has became (function(){google.maps.Unload();}) That is not good! The code in gmap2 has not changed. It use : response.render(OnEventHeaderItem.forScript(window, onUnload, But this looks wrong. 1) OnLoadHeaderItem can be used 2) or OnEventHeaderItem with 'unload' event. Note that there is no 'on' prefix when using event registration google.maps.Unload();)); that produce : @Override public void render(Response response) { JavaScriptUtils.writeJavaScript(response, Wicket.Event.add( + getTarget() + , \ + getEvent() + \, function(event) { + getJavaScript() + ;});); } In wicket 6.8 when I refresh the map, the program does go in the render function, but not in wicket 6.9. That is very strange... *I think it has something to do with : https://issues.apache.org/jira/browse/WICKET-5234* You can reproduce it using gmap2-exmaple in the listener page. Just click on the true/false button and then the map get stuck! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564.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: gmap2, wicket 6.9 and ajax refresh
Martin Grigorov-4 wrote But this looks wrong. 1) OnLoadHeaderItem can be used 2) or OnEventHeaderItem with 'unload' event. Note that there is no 'on' prefix when using event registration So what you mean is that in GMapHeaderContributor.java the line response.render(OnEventHeaderItem.forScript(window, *onUnload*, google.maps.Unload();)); should be response.render(OnEventHeaderItem.forScript(window, *unload*, google.maps.Unload();)); This has been wrong for all those years... or is it only the way to go for wicket 6? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660584.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: gmap2, wicket 6.9 and ajax refresh
Martin in the javadoc there's an example saying onclick. So should it be click? /** * Creates a {@link OnEventHeaderItem} for the given parameters. * * @param target *The target of the event handler, for example 'window' or 'document'. * @param event *The event itself, for example '*onclick*'. * @param javaScript *The script to execute on the event. * * @return A newly created {@link OnEventHeaderItem}. */ public static OnEventHeaderItem forScript(String target, String event, CharSequence javaScript) { return new OnEventHeaderItem(target, event, javaScript); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660586.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: gmap2, wicket 6.9 and ajax refresh
If I remember well click or on click should work, the on prefix is automatically removed if it is present. Regards, Le 31 juil. 2013 20:47, Gabriel Landon glan...@piti.pf a écrit : Martin in the javadoc there's an example saying onclick. So should it be click? /** * Creates a {@link OnEventHeaderItem} for the given parameters. * * @param target *The target of the event handler, for example 'window' or 'document'. * @param event *The event itself, for example '*onclick*'. * @param javaScript *The script to execute on the event. * * @return A newly created {@link OnEventHeaderItem}. */ public static OnEventHeaderItem forScript(String target, String event, CharSequence javaScript) { return new OnEventHeaderItem(target, event, javaScript); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660586.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: gmap2, wicket 6.9 and ajax refresh
Sorry to have bother you with this. There's already an issue open for this for those who have the same problem! https://issues.apache.org/jira/browse/WICKET-5248 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660565.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