You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hunter Kelly <hk...@newbay.com> on 2004/03/02 14:48:18 UTC

How to submit a form to a different page?

I have a home page with a small login form.  There is also
a full login page.  I want all the validation logic (well, not
necessarily the client side java script) to get triggered when
the form is submitted, ie, if there are errors when a user tries to
login, they are taken to the login page with the errors displayed,
as if they had tried to do it from the login page in the first place.

I tried a simple method in the home page like this:


    public void login(IRequestCycle cycle) 
    { 
        Login login = (Login) cycle.getPage("Login");
        login.setUserName(getUserName());
        login.setPassword(getPassword());
        cycle.get
        login.validate(cycle);
        login.login(cycle);
    } 
    


But that didn't really seem to have the desired effects - the
validation doesn't seem to take place.

Ideally, in the login page it would be nice if I could do:

<form jwcid="@Form" listener="ognl:pages.Login.listeners.login">

or something similar.

Thanks,

Hunter



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org