Why don't I get onSubmit() for my form?
I can't figure out why my form's onSubmit isn't firing when I click my submit button. Can anyone see what I've done wrong? Here's the HTML: http://pastebin.com/m5b1440a0 Here's Java code: http://pastebin.com/m4a217d31 At line#114, onSubmit is not being called. I've tried lots of different things - I've tried adding a wicket:id to make it a Link, it gets execution flow, but without the model having been updated yet, which isn't really what I want. Similarly, I can make it a Button, but that also doesn't get the onSubmit. Any tips for me? I feel like I'm missing something really simple... Thanks, -- Jim (To see the larger app this is a part of, goto: http://firstuucolumbus.org/auction)
Re: Why don't I get onSubmit() for my form?
Jim, Temporarily add a FeedbackPanel to make sure you are successfully getting through validation. There's much too much irrelevant code there (to demonstrate such a problem), but I did notice, for instance, that you're using a RequiredTextField which means that the form must have a value for that field, otherwise the form processing lifecyle will be cut short - one of the consequences of failing validation is that onSubmit() will not get called, onError() will. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Jim Pinkham wrote: I can't figure out why my form's onSubmit isn't firing when I click my submit button. Can anyone see what I've done wrong? Here's the HTML: http://pastebin.com/m5b1440a0 Here's Java code: http://pastebin.com/m4a217d31 At line#114, onSubmit is not being called. I've tried lots of different things - I've tried adding a wicket:id to make it a Link, it gets execution flow, but without the model having been updated yet, which isn't really what I want. Similarly, I can make it a Button, but that also doesn't get the onSubmit. Any tips for me? I feel like I'm missing something really simple... Thanks, -- Jim (To see the larger app this is a part of, goto: http://firstuucolumbus.org/auction) -- View this message in context: http://www.nabble.com/Why-don%27t-I-get-onSubmit%28%29-for-my-form--tp20446473p20447007.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why don't I get onSubmit() for my form?
Any tips for me? I feel like I'm missing something really simple... Override the Form's onError() -method, to check whether there's a validation error you haven't noticed. -Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why don't I get onSubmit() for my form?
Thanks! That helped me find the problem - I broke it when I added this to get $ prefix for my Double (in this app all doubles are currency) values: converterLocator.set(Double.class, new AbstractDecimalConverter() { private static final long serialVersionUID = 1L; @Override public NumberFormat getNumberFormat(Locale locale) { return NumberFormat.getCurrencyInstance(); } // from DoubleConverter public Object convertToObject(final String value, Locale locale) { final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); if (number == null) return null; return new Double(number.doubleValue()); } @SuppressWarnings(unchecked) protected Class getTargetType() { return Double.class; } }); Seemed like a good idea, except I forgot about input! oops! So, I'll take away from this the lesson to always have a feedback panel someplace on any form. Thanks again, -- Jim. On Tue, Nov 11, 2008 at 2:51 PM, jWeekend [EMAIL PROTECTED]wrote: Jim, Temporarily add a FeedbackPanel to make sure you are successfully getting through validation. There's much too much irrelevant code there (to demonstrate such a problem), but I did notice, for instance, that you're using a RequiredTextField which means that the form must have a value for that field, otherwise the form processing lifecyle will be cut short - one of the consequences of failing validation is that onSubmit() will not get called, onError() will. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Jim Pinkham wrote: I can't figure out why my form's onSubmit isn't firing when I click my submit button. Can anyone see what I've done wrong? Here's the HTML: http://pastebin.com/m5b1440a0 Here's Java code: http://pastebin.com/m4a217d31 At line#114, onSubmit is not being called. I've tried lots of different things - I've tried adding a wicket:id to make it a Link, it gets execution flow, but without the model having been updated yet, which isn't really what I want. Similarly, I can make it a Button, but that also doesn't get the onSubmit. Any tips for me? I feel like I'm missing something really simple... Thanks, -- Jim (To see the larger app this is a part of, goto: http://firstuucolumbus.org/auction) -- View this message in context: http://www.nabble.com/Why-don%27t-I-get-onSubmit%28%29-for-my-form--tp20446473p20447007.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why don't I get onSubmit() for my form?
Is the onError getting called for the form? -- Christopher J Lyth [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why don't I get onSubmit() for my form?
Thanks to all who helped find this - yes, it was failing to validate my input numeric 123.45. I came up with this fix in my application class: protected IConverterLocator newConverterLocator() { converterLocator.set(Double.class, new AbstractDecimalConverter() { private static final long serialVersionUID = 1L; IConverter delegate = DoubleConverter.INSTANCE; @Override public String convertToString(final Object value, Locale locale) { return Currency.getInstance(locale).getSymbol() + super.convertToString(value, locale); } @Override protected Class getTargetType() { return Double.class; } public Object convertToObject(String value, Locale locale) { if (value != null value.startsWith(Currency.getInstance(locale).getSymbol())) value = value.substring(1); return delegate.convertToObject(value, locale); } }); Thanks, -- Jim. On Tue, Nov 11, 2008 at 2:29 PM, Christopher Lyth [EMAIL PROTECTED] wrote: Is the onError getting called for the form? -- Christopher J Lyth [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]