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 wrote: >> Hey, >> I have a form and I want to submit it via Ajax: >> >> >> >> >> >> >> >> >> >> >> >> >> >> > wicket:id="note"> >> >> >> >> >> >> >> >> >> >> 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
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 wrote: > Hey, > I have a form and I want to submit it via Ajax: > > > > > > > > > > > > > > wicket:id="note"> > > > > > > > > > > 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
You should implement the onError method of the button and update feedback panel to see possible validation errors. ** Martin 2009/4/19 HHB : > Hey, > I have a form and I want to submit it via Ajax: > > > > > > > > > > > > > > wicket:id="note"> > > > > > > > > > >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
Submitting form via Ajax isn't working
Hey, I have a form and I want to submit it via Ajax: 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