Re: Generate markup for hidden framework form field?

2009-06-13 Thread Uwe Schäfer
janneru schrieb: i also just found a similar one by uwe schaefer: http://www.codesmell.org/blog/2008/12/wicket-secureform/ cheers uwe. note that it is just a copy of what mighty igor posted here :) i´m using it in production a lot. thx again, igor. cu uwe

Re: Generate markup for hidden framework form field?

2009-05-29 Thread janneru
thx jörn for sharing ur solution! i also just found a similar one by uwe schaefer: http://www.codesmell.org/blog/2008/12/wicket-secureform/ cheers uwe. On Tue, May 26, 2009 at 2:43 PM, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Thanks guys! The end result looks like this, works fine,

Re: Generate markup for hidden framework form field?

2009-05-26 Thread Jörn Zaefferer
How is that going the fix the problem? I'd end up with markup, but no behaviour on top of it. Jörn On Mon, May 25, 2009 at 5:52 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: right, so remove that code since you have replaced that component with pure markup. -igor On Mon, May 25, 2009 at

Re: Generate markup for hidden framework form field?

2009-05-26 Thread Maarten Bosteels
When you write it out with oncomponenttagbody it's not part of the component hierarchy, it's just rendered markup. Once the form is submitted, you can retrieve the value using the servlet API. What behavior would you want to add on top ? Maarten On Tue, May 26, 2009 at 12:17 PM, Jörn Zaefferer

Re: Generate markup for hidden framework form field?

2009-05-26 Thread Jörn Zaefferer
The current component (the HiddenField) checks that the same value that it started with, is submitted. I'll try to replace that using a form validator that reads the parameter directly. Thanks Jörn On Tue, May 26, 2009 at 1:32 PM, Maarten Bosteels mbosteels@gmail.com wrote: When you write

Re: Generate markup for hidden framework form field?

2009-05-26 Thread Jörn Zaefferer
Thanks guys! The end result looks like this, works fine, and removed a lot of html boilderplate from our templates: public SecureForm(String id, IModelT model) { super(id, model); setMarkupId(id); add(new IFormValidator() { @Override public

Generate markup for hidden framework form field?

2009-05-25 Thread Jörn Zaefferer
Hi, my application uses a form subclass everywhere for CSRF protection. Each form needs a hidden field like this: input type=hidden wicket:id=csrf-protection / The wicket component for that is added by the form subclass (SecureForm) which all other forms in the application extend. Currently each

Re: Generate markup for hidden framework form field?

2009-05-25 Thread Igor Vaynberg
if you write it out in oncomponenttagbody then you dont need it in the markupo anymore. -igor On Mon, May 25, 2009 at 6:32 AM, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Hi, my application uses a form subclass everywhere for CSRF protection. Each form needs a hidden field like

Re: Generate markup for hidden framework form field?

2009-05-25 Thread Jörn Zaefferer
That was the idea. But Wicket still can't find the component markup when looking for it. The form adds this elsewhere: add(new HiddenFieldString(csrf-protection, new ModelString(csrfProtection())).setRequired(true).add(new IValidatorString() { public void validate(IValidatableString

Re: Generate markup for hidden framework form field?

2009-05-25 Thread Igor Vaynberg
right, so remove that code since you have replaced that component with pure markup. -igor On Mon, May 25, 2009 at 8:48 AM, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: That was the idea. But Wicket still can't find the component markup when looking for it. The form adds this elsewhere: