AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
All, I have a simple application where I can change the size, position, and color of a div within a page. When I click on the div I want some functionality to be performed, however the onclick event is never being returned to the server, and is instead intercepted and rejected by the javascript, I get the error Ajax GET stopped because of precondition check, url:;jsessionid=e80700c56cdf00f163ab8b7adb38?wicket:interface=:0:superDiv::IBehaviorListener:0: HomePage.java - public class HomePage extends BasePage { CompoundPropertyModelRectInfo rectInfoModel = new CompoundPropertyModelRectInfo(new RectInfo(100, 100, 400, 400, blue)); WebMarkupContainer superDiv = new SuperDiv(superDiv, rectInfoModel); public HomePage(){ ... form setup ... superDiv.add(new AjaxEventBehavior(onmousedown) { @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(dicks); } }); add(superDiv.setOutputMarkupId(true)); } private class SuperDiv extends WebMarkupContainer { IModelRectInfo rectInfoModel; public SuperDiv(String id, IModelRectInfo rectInfoModel) { super(id); this.rectInfoModel = rectInfoModel; } @Override protected void onComponentTag(ComponentTag tag) { tag.put(style, position: static; + top: + getModelObject().getTop() + ; + left: + getModelObject().getLeft() + ; + height: + getModelObject().getHeight() + ; + width: + getModelObject().getWidth() + ; + background-color: + getModelObject().getColor() + ;); } public RectInfo getModelObject() { return rectInfoModel.getObject(); } public void setModelObject(RectInfo rectInfo) { rectInfoModel.setObject(rectInfo); } } The markup is simple, I can post that if requested, but it's just a div with a wicket:id tag. Thanks in advance!
Re: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
since the error is thrown on the browser side a dump of the generated html source might be more helpful. try http://papernapkin.org/pastebin/home for posting that dump mf Am 17.06.2009 um 15:58 schrieb Justin Boyd: All, I have a simple application where I can change the size, position, and color of a div within a page. When I click on the div I want some functionality to be performed, however the onclick event is never being returned to the server, and is instead intercepted and rejected by the javascript, I get the error Ajax GET stopped because of precondition check, url:;jsessionid=e80700c56cdf00f163ab8b7adb38?wicket:interface=: 0:superDiv::IBehaviorListener:0: HomePage.java - public class HomePage extends BasePage { CompoundPropertyModelRectInfo rectInfoModel = new CompoundPropertyModelRectInfo(new RectInfo(100, 100, 400, 400, blue)); WebMarkupContainer superDiv = new SuperDiv(superDiv, rectInfoModel); public HomePage(){ ... form setup ... superDiv.add(new AjaxEventBehavior(onmousedown) { @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(dicks); } }); add(superDiv.setOutputMarkupId(true)); } private class SuperDiv extends WebMarkupContainer { IModelRectInfo rectInfoModel; public SuperDiv(String id, IModelRectInfo rectInfoModel) { super(id); this.rectInfoModel = rectInfoModel; } @Override protected void onComponentTag(ComponentTag tag) { tag.put(style, position: static; + top: + getModelObject().getTop() + ; + left: + getModelObject().getLeft() + ; + height: + getModelObject().getHeight() + ; + width: + getModelObject().getWidth() + ; + background-color: + getModelObject().getColor() + ;); } public RectInfo getModelObject() { return rectInfoModel.getObject(); } public void setModelObject(RectInfo rectInfo) { rectInfoModel.setObject(rectInfo); } } The markup is simple, I can post that if requested, but it's just a div with a wicket:id tag. Thanks in advance! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
Martin, I actually don't know how to get that dump, i'm using firefox, the error I posted was from the AjaxDebugBox, any tips on getting the client side dump? I have firebug, but don't seem to see any JavaScript errors, although admittedly I don't know anything about using it for JavaScript debugging. Martin Funk-3 wrote: since the error is thrown on the browser side a dump of the generated html source might be more helpful. try http://papernapkin.org/pastebin/home for posting that dump mf Am 17.06.2009 um 15:58 schrieb Justin Boyd: All, I have a simple application where I can change the size, position, and color of a div within a page. When I click on the div I want some functionality to be performed, however the onclick event is never being returned to the server, and is instead intercepted and rejected by the javascript, I get the error Ajax GET stopped because of precondition check, url:;jsessionid=e80700c56cdf00f163ab8b7adb38?wicket:interface=: 0:superDiv::IBehaviorListener:0: HomePage.java - public class HomePage extends BasePage { CompoundPropertyModelRectInfo rectInfoModel = new CompoundPropertyModelRectInfo(new RectInfo(100, 100, 400, 400, blue)); WebMarkupContainer superDiv = new SuperDiv(superDiv, rectInfoModel); public HomePage(){ ... form setup ... superDiv.add(new AjaxEventBehavior(onmousedown) { @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(dicks); } }); add(superDiv.setOutputMarkupId(true)); } private class SuperDiv extends WebMarkupContainer { IModelRectInfo rectInfoModel; public SuperDiv(String id, IModelRectInfo rectInfoModel) { super(id); this.rectInfoModel = rectInfoModel; } @Override protected void onComponentTag(ComponentTag tag) { tag.put(style, position: static; + top: + getModelObject().getTop() + ; + left: + getModelObject().getLeft() + ; + height: + getModelObject().getHeight() + ; + width: + getModelObject().getWidth() + ; + background-color: + getModelObject().getColor() + ;); } public RectInfo getModelObject() { return rectInfoModel.getObject(); } public void setModelObject(RectInfo rectInfo) { rectInfoModel.setObject(rectInfo); } } The markup is simple, I can post that if requested, but it's just a div with a wicket:id tag. Thanks in advance! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24075168.html Sent from the Wicket - User 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: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
ok, wrong wording on my side. i meant the html source of the page in the browser. mf Am 17.06.2009 um 16:41 schrieb walnutmon: Martin, I actually don't know how to get that dump, i'm using firefox, the error I posted was from the AjaxDebugBox, any tips on getting the client side dump? I have firebug, but don't seem to see any JavaScript errors, although admittedly I don't know anything about using it for JavaScript debugging. Martin Funk-3 wrote: since the error is thrown on the browser side a dump of the generated html source might be more helpful. try http://papernapkin.org/pastebin/home for posting that dump mf Am 17.06.2009 um 15:58 schrieb Justin Boyd: All, I have a simple application where I can change the size, position, and color of a div within a page. When I click on the div I want some functionality to be performed, however the onclick event is never being returned to the server, and is instead intercepted and rejected by the javascript, I get the error Ajax GET stopped because of precondition check, url:;jsessionid=e80700c56cdf00f163ab8b7adb38?wicket:interface=: 0:superDiv::IBehaviorListener:0: HomePage.java - public class HomePage extends BasePage { CompoundPropertyModelRectInfo rectInfoModel = new CompoundPropertyModelRectInfo(new RectInfo(100, 100, 400, 400, blue)); WebMarkupContainer superDiv = new SuperDiv(superDiv, rectInfoModel); public HomePage(){ ... form setup ... superDiv.add(new AjaxEventBehavior(onmousedown) { @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(dicks); } }); add(superDiv.setOutputMarkupId(true)); } private class SuperDiv extends WebMarkupContainer { IModelRectInfo rectInfoModel; public SuperDiv(String id, IModelRectInfo rectInfoModel) { super(id); this.rectInfoModel = rectInfoModel; } @Override protected void onComponentTag(ComponentTag tag) { tag.put(style, position: static; + top: + getModelObject().getTop() + ; + left: + getModelObject().getLeft() + ; + height: + getModelObject().getHeight() + ; + width: + getModelObject().getWidth() + ; + background-color: + getModelObject().getColor() + ;); } public RectInfo getModelObject() { return rectInfoModel.getObject(); } public void setModelObject(RectInfo rectInfo) { rectInfoModel.setObject(rectInfo); } } The markup is simple, I can post that if requested, but it's just a div with a wicket:id tag. Thanks in advance! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24075168.html Sent from the Wicket - User 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head title/title /head body form wicket:id=form top: input type=text wicket:id=top/br/ left: input type=text wicket:id=left/br/ length: input type=text wicket:id=height/br/ width: input type=text wicket:id=width/br/ color: input type=text wicket:id=color/br/ input type=submit/ /form div wicket:id=superDiv/div /body /html Martin Funk-3 wrote: ok, wrong wording on my side. i meant the html source of the page in the browser. mf -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24076448.html Sent from the Wicket - User 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: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
close, but no cigar http://www.phrases.org.uk/meanings/close-but-no-cigar.html not the html of the component or page that you created in the ide. i think it might be helpful to see the html that the browser received. in firefox there ought to be a menu item like: View - show Sourcecode (i'm using firefox with a german locale, so the naming might be slightly different) mf Am 17.06.2009 um 17:44 schrieb walnutmon: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head title/title /head body form wicket:id=form top: input type=text wicket:id=top/br/ left: input type=text wicket:id=left/br/ length: input type=text wicket:id=height/br/ width: input type=text wicket:id=width/br/ color: input type=text wicket:id=color/br/ input type=submit/ /form div wicket:id=superDiv/div /body /html Martin Funk-3 wrote: ok, wrong wording on my side. i meant the html source of the page in the browser. mf -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24076448.html Sent from the Wicket - User 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
Close but no donut, copper. That occurred to me, but it was too late. The source doesn't seem to give much away, I do see the JavaScript on the Div though. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head title/title script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]]*//script /head body form wicket:id=form id=form1 method=post action=?wicket:interface=:0:form::IFormSubmitListener::div style=display:noneinput type=hidden name=form1_hf_0 id=form1_hf_0 //div top: input type=text wicket:id=top value=400 name=top/br/ left: input type=text wicket:id=left value=400 name=left/br/ length: input type=text wicket:id=height value=100 name=height/br/ width: input type=text wicket:id=width value=100 name=width/br/ color: input type=text wicket:id=color value=blue name=color/br/ input type=submit/ /form div wicket:id=superDiv style=position: static;top: 400;left: 400;height: 100;width: 100;background-color: blue; onmousedown=var wcall=wicketAjaxGet('?wicket:interface=:0:superDiv::IBehaviorListener:0:',null,null, function() {return Wicket.$('superDiv2') != null;}.bind(this));/div /body /html Thanks again -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24078270.html Sent from the Wicket - User 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: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
hm... lets see, the JavaScript in the Browser complains since: function() {return Wicket.$('superDiv2') != null;}.bind(this)) returns false. (its the precondition) It returns false since there is no dom element with the id 'superDiv2' in the page. I assume its the id of the div elements, but the id is not rendered. Which is strange since add(superDiv.setOutputMarkupId(true)); got called. Next shoot would be the overridden onComponentTag() method. I'd say a call to super.onComponentTag() is needed. Maybe that should be described more explicit in the JavaDoc. mf Am 17.06.2009 um 19:25 schrieb walnutmon: Close but no donut, copper. That occurred to me, but it was too late. The source doesn't seem to give much away, I do see the JavaScript on the Div though. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head title/title script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/ wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket- ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/ wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]]*//script /head body form wicket:id=form id=form1 method=post action=?wicket:interface=:0:form::IFormSubmitListener::div style=display:noneinput type=hidden name=form1_hf_0 id=form1_hf_0 //div top: input type=text wicket:id=top value=400 name=top/br/ left: input type=text wicket:id=left value=400 name=left/br/ length: input type=text wicket:id=height value=100 name=height/br/ width: input type=text wicket:id=width value=100 name=width/br/ color: input type=text wicket:id=color value=blue name=color/br/ input type=submit/ /form div wicket:id=superDiv style=position: static;top: 400;left: 400;height: 100;width: 100;background-color: blue; onmousedown=var wcall=wicketAjaxGet('?wicket:interface=: 0:superDiv::IBehaviorListener:0:',null,null, function() {return Wicket.$('superDiv2') != null;}.bind(this));/ div /body /html Thanks again -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24078270.html Sent from the Wicket - User 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
For the record, the call to super.onComponentTag(tag) fixed the issue. Awesome catch Martin! Martin Funk-3 wrote: hm... lets see, the JavaScript in the Browser complains since: function() {return Wicket.$('superDiv2') != null;}.bind(this)) returns false. (its the precondition) It returns false since there is no dom element with the id 'superDiv2' in the page. I assume its the id of the div elements, but the id is not rendered. Which is strange since add(superDiv.setOutputMarkupId(true)); got called. Next shoot would be the overridden onComponentTag() method. I'd say a call to super.onComponentTag() is needed. Maybe that should be described more explicit in the JavaDoc. mf Am 17.06.2009 um 19:25 schrieb walnutmon: Close but no donut, copper. That occurred to me, but it was too late. The source doesn't seem to give much away, I do see the JavaScript on the Div though. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head title/title script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/ wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket- ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/ wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]]*//script /head body form wicket:id=form id=form1 method=post action=?wicket:interface=:0:form::IFormSubmitListener::div style=display:noneinput type=hidden name=form1_hf_0 id=form1_hf_0 //div top: input type=text wicket:id=top value=400 name=top/br/ left: input type=text wicket:id=left value=400 name=left/br/ length: input type=text wicket:id=height value=100 name=height/br/ width: input type=text wicket:id=width value=100 name=width/br/ color: input type=text wicket:id=color value=blue name=color/br/ input type=submit/ /form div wicket:id=superDiv style=position: static;top: 400;left: 400;height: 100;width: 100;background-color: blue; onmousedown=var wcall=wicketAjaxGet('?wicket:interface=: 0:superDiv::IBehaviorListener:0:',null,null, function() {return Wicket.$('superDiv2') != null;}.bind(this));/ div /body /html Thanks again -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24078270.html Sent from the Wicket - User 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24079175.html Sent from the Wicket - User 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: AjaxEventBehavior onclick for WebMarkupContainer Precondition Check
Am 17.06.2009 um 20:15 schrieb walnutmon: For the record, the call to super.onComponentTag(tag) fixed the issue. Awesome catch Martin! Thank you, your welcome. (and not to forget, I had my fun too) mf Martin Funk-3 wrote: hm... lets see, the JavaScript in the Browser complains since: function() {return Wicket.$('superDiv2') != null;}.bind(this)) returns false. (its the precondition) It returns false since there is no dom element with the id 'superDiv2' in the page. I assume its the id of the div elements, but the id is not rendered. Which is strange since add(superDiv.setOutputMarkupId(true)); got called. Next shoot would be the overridden onComponentTag() method. I'd say a call to super.onComponentTag() is needed. Maybe that should be described more explicit in the JavaDoc. mf Am 17.06.2009 um 19:25 schrieb walnutmon: Close but no donut, copper. That occurred to me, but it was too late. The source doesn't seem to give much away, I do see the JavaScript on the Div though. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head title/title script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/ wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket- ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/ wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]]*//script /head body form wicket:id=form id=form1 method=post action=?wicket:interface=:0:form::IFormSubmitListener::div style=display:noneinput type=hidden name=form1_hf_0 id=form1_hf_0 //div top: input type=text wicket:id=top value=400 name=top/br/ left: input type=text wicket:id=left value=400 name=left/br/ length: input type=text wicket:id=height value=100 name=height/br/ width: input type=text wicket:id=width value=100 name=width/br/ color: input type=text wicket:id=color value=blue name=color/br/ input type=submit/ /form div wicket:id=superDiv style=position: static;top: 400;left: 400;height: 100;width: 100;background-color: blue; onmousedown=var wcall=wicketAjaxGet('?wicket:interface=: 0:superDiv::IBehaviorListener:0:',null,null, function() {return Wicket.$('superDiv2') != null;}.bind(this));/ div /body /html Thanks again -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24078270.html Sent from the Wicket - User 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/AjaxEventBehavior-onclick-for-WebMarkupContainer-Precondition-Check-tp24074285p24079175.html Sent from the Wicket - User 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org