Submitting form via Ajax isn't working
Hey, I have a form and I want to submit it via Ajax: wicket:panel form wicket:id=form div wicket:id=feedback/div table width=100% cellpadding=2 cellspacing=2 tr tdlabelwicket:message key=name/ /label/td tdspan wicket:id=nameBorder input type=text wicket:id=name//span/td /tr tr tdwicket:message key=note//td tdtextarea cols=20 rows=10 wicket:id=note/textarea/td /tr tr td colspan=2 input wicket:id=create type=button value=Create Group//td /tr /table /form /wicket:panel public CreateGroupPanel(String id) { super(id); setOutputMarkupId(true); final Form form = new Form(form, new CompoundPropertyModel(new Group())); add(form); form.add(new FeedbackPanel(feedback)); form.add(new FormComponentFeedbackBorder(nameBorder).add(new TextField(name).setRequired(true))); form.add(new TextArea(note)); form.add(new AjaxSubmitLink(create) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { Group group = (Group) form.getModelObject(); System.out.println(Logging: + group); } }); } But nothing is got print on the console. Any ideas what is going wrong? FireFox 3.0.7 Ubuntu 8.10 Wicket 1.3.5 Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Submitting form via Ajax isn't working
You should implement the onError method of the button and update feedback panel to see possible validation errors. ** Martin 2009/4/19 HHB hubaghd...@yahoo.ca: Hey, I have a form and I want to submit it via Ajax: wicket:panel form wicket:id=form div wicket:id=feedback/div table width=100% cellpadding=2 cellspacing=2 tr tdlabelwicket:message key=name/ /label/td tdspan wicket:id=nameBorder input type=text wicket:id=name//span/td /tr tr tdwicket:message key=note//td tdtextarea cols=20 rows=10 wicket:id=note/textarea/td /tr tr td colspan=2 input wicket:id=create type=button value=Create Group//td /tr /table /form /wicket:panel public CreateGroupPanel(String id) { super(id); setOutputMarkupId(true); final Form form = new Form(form, new CompoundPropertyModel(new Group())); add(form); form.add(new FeedbackPanel(feedback)); form.add(new FormComponentFeedbackBorder(nameBorder).add(new TextField(name).setRequired(true))); form.add(new TextArea(note)); form.add(new AjaxSubmitLink(create) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { Group group = (Group) form.getModelObject(); System.out.println(Logging: + group); } }); } But nothing is got print on the console. Any ideas what is going wrong? FireFox 3.0.7 Ubuntu 8.10 Wicket 1.3.5 Thanks. - 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: Submitting form via Ajax isn't working
All looks good to me, my guess is that you aren't entering in a name, and so you're failing validation, but you haven't implemented onError to add the feedback panel to the target in that case. Also, your feedback panel probably needs setOutputMarkupId(true) to be of any use, given that you're submitting with ajax. -Clint On Sun, Apr 19, 2009 at 9:11 AM, HHB hubaghd...@yahoo.ca wrote: Hey, I have a form and I want to submit it via Ajax: wicket:panel form wicket:id=form div wicket:id=feedback/div table width=100% cellpadding=2 cellspacing=2 tr tdlabelwicket:message key=name/ /label/td tdspan wicket:id=nameBorder input type=text wicket:id=name//span/td /tr tr tdwicket:message key=note//td tdtextarea cols=20 rows=10 wicket:id=note/textarea/td /tr tr td colspan=2 input wicket:id=create type=button value=Create Group//td /tr /table /form /wicket:panel public CreateGroupPanel(String id) { super(id); setOutputMarkupId(true); final Form form = new Form(form, new CompoundPropertyModel(new Group())); add(form); form.add(new FeedbackPanel(feedback)); form.add(new FormComponentFeedbackBorder(nameBorder).add(new TextField(name).setRequired(true))); form.add(new TextArea(note)); form.add(new AjaxSubmitLink(create) { �...@override protected void onSubmit(AjaxRequestTarget target, Form form) { Group group = (Group) form.getModelObject(); System.out.println(Logging: + group); } }); } But nothing is got print on the console. Any ideas what is going wrong? FireFox 3.0.7 Ubuntu 8.10 Wicket 1.3.5 Thanks. - 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: Submitting form via Ajax isn't working
Yes, you are right. My isssue is solved now, thanks. cpopetz wrote: All looks good to me, my guess is that you aren't entering in a name, and so you're failing validation, but you haven't implemented onError to add the feedback panel to the target in that case. Also, your feedback panel probably needs setOutputMarkupId(true) to be of any use, given that you're submitting with ajax. -Clint On Sun, Apr 19, 2009 at 9:11 AM, HHB hubaghd...@yahoo.ca wrote: Hey, I have a form and I want to submit it via Ajax: wicket:panel form wicket:id=form div wicket:id=feedback/div table width=100% cellpadding=2 cellspacing=2 tr tdlabelwicket:message key=name/ /label/td td input type=text wicket:id=name//td /tr tr tdwicket:message key=note//td tdtextarea cols=20 rows=10 wicket:id=note/textarea/td /tr tr td colspan=2 input wicket:id=create type=button value=Create Group//td /tr /table /form /wicket:panel public CreateGroupPanel(String id) { super(id); setOutputMarkupId(true); final Form form = new Form(form, new CompoundPropertyModel(new Group())); add(form); form.add(new FeedbackPanel(feedback)); form.add(new FormComponentFeedbackBorder(nameBorder).add(new TextField(name).setRequired(true))); form.add(new TextArea(note)); form.add(new AjaxSubmitLink(create) { �...@override protected void onSubmit(AjaxRequestTarget target, Form form) { Group group = (Group) form.getModelObject(); System.out.println(Logging: + group); } }); } But nothing is got print on the console. Any ideas what is going wrong? FireFox 3.0.7 Ubuntu 8.10 Wicket 1.3.5 Thanks. - 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/Submitting-form-via-Ajax-isn%27t-working-tp23123367p23123825.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