Re: Stateless form throws Unexpected RuntimeException
Thanks for your replie Martin. Really if submitting the form the parameter constructor is called. I tried to delete this constructor (parameter) and the page actually only have one constructor (without parameter) and runs... I don't understand how page run without the parameter constructor in stateless page. When the page have this constructor it's called and runtime exceptions ocurrs, and if parameter constructor is deleted page works? With this works fine: public final class Test extends WebPage { public Test () { super (); StatelessForm Form = new StatelessForm(formData){ public void onSubmit() { System.out.println(Enter);} }; add(Form); this.setStatelessHint(true); } //Parameter constructor deleted!! } - Another wicket newbie programmer Wicket en Español - http://aprendiendowicket.wordpress.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Stateless-form-throws-Unexpected-RuntimeException-tp3434187p3435643.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: Stateless form throws Unexpected RuntimeException
Better use only a constructor with PageParameters or chain them as I suggested you already. new MyPage() { this(new PageParameters()); } new MyPage(PageParameters params) { super(params); .. here do your logic } On Fri, Apr 8, 2011 at 10:37 AM, Juansoft andresnet2...@yahoo.es wrote: Thanks for your replie Martin. Really if submitting the form the parameter constructor is called. I tried to delete this constructor (parameter) and the page actually only have one constructor (without parameter) and runs... I don't understand how page run without the parameter constructor in stateless page. When the page have this constructor it's called and runtime exceptions ocurrs, and if parameter constructor is deleted page works? With this works fine: public final class Test extends WebPage { public Test () { super (); StatelessForm Form = new StatelessForm(formData){ public void onSubmit() { System.out.println(Enter);} }; add(Form); this.setStatelessHint(true); } //Parameter constructor deleted!! } - Another wicket newbie programmer Wicket en Español - http://aprendiendowicket.wordpress.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Stateless-form-throws-Unexpected-RuntimeException-tp3434187p3435643.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Stateless form throws Unexpected RuntimeException
Hello i am getting a strange problem when i use stateless form in a simple wicket stateless page. this is the HTML side: Test! Enter And this is the java side: public final class Test extends WebPage { public Test () { super (); StatelessForm Form = new StatelessForm(formData){ public void onSubmit() { System.out.println(Enter);} }; add(Form); this.setStatelessHint(true); } public Test (PageParameters params) { //TODO: process page parameters } } When i click submit button called enter, wicket throws one runtime exception like this: WicketMessage: unable to find component with path formData on stateless page [Page class = com.pages.Test, id = 0, version = 0] it could be that the component is inside a repeater make your component return false in getStatelessHint() ¿Where is the repeater component? I'm going crazy with this error, ¿can someone help me? Thanks a lot! PD. I'm using wicket 1.4.17 - Another wicket newbie programmer Wicket en Español - http://aprendiendowicket.wordpress.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Stateless-form-throws-Unexpected-RuntimeException-tp3434187p3434187.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: Stateless form throws Unexpected RuntimeException
chain the constructors the form is never created when the ctor with PageParameters is used, i.e when you submit On Thu, Apr 7, 2011 at 8:30 PM, Juansoft andresnet2...@yahoo.es wrote: Hello i am getting a strange problem when i use stateless form in a simple wicket stateless page. this is the HTML side: Test! Enter And this is the java side: public final class Test extends WebPage { public Test () { super (); StatelessForm Form = new StatelessForm(formData){ public void onSubmit() { System.out.println(Enter);} }; add(Form); this.setStatelessHint(true); } public Test (PageParameters params) { //TODO: process page parameters } } When i click submit button called enter, wicket throws one runtime exception like this: WicketMessage: unable to find component with path formData on stateless page [Page class = com.pages.Test, id = 0, version = 0] it could be that the component is inside a repeater make your component return false in getStatelessHint() ¿Where is the repeater component? I'm going crazy with this error, ¿can someone help me? Thanks a lot! PD. I'm using wicket 1.4.17 - Another wicket newbie programmer Wicket en Español - http://aprendiendowicket.wordpress.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Stateless-form-throws-Unexpected-RuntimeException-tp3434187p3434187.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/