You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Илья Нарыжный <ph...@ydn.ru> on 2011/11/13 13:20:03 UTC

Validate form on page start

Hello,

I have following case:
There is RegistrationPage in the project. This page fill attributes of new
User and persists in the database.
But for registration from social networks we want to implement following:
show to new user the same RegistrationPage with filled fields according to
data recieved from social networks and highlighted errors (for example if
EMAIL was not filled).

So, is it possible to redirect user to some page with already validated
form?

Thanks,
Ilia

Re: Validate form on page start

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный <ph...@ydn.ru> wrote:
> Hello,
>
> I have following case:
> There is RegistrationPage in the project. This page fill attributes of new
> User and persists in the database.
> But for registration from social networks we want to implement following:
> show to new user the same RegistrationPage with filled fields according to
> data recieved from social networks and highlighted errors (for example if
> EMAIL was not filled).
>
> So, is it possible to redirect user to some page with already validated
> form?

Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
that just calls org.apache.wicket.markup.html.form.Form.validate() (it
is protected final).

Instantiate that page and populate the form components' models (or
populate page's pageparameters) and at the end call
myForm.myvalidate().


>
> Thanks,
> Ilia
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org