You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by fabs <lo...@gmail.com> on 2012/09/03 11:11:51 UTC

Submitting a form from another page

Hello all.

My website has a login page, with a username and password field. However, I
wish to show an inline login form on all pages when the user is not logged
in, and submit the login request from any page to the main login page (to
allow errors to be displayed in case login is unsuccessful). I am having
trouble finding how to fit this use case into tapestry5.

Thank you for any advice. 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-form-from-another-page-tp5715999.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Submitting a form from another page

Posted by "mailinglist@j-b-s.de" <ma...@j-b-s.de>.
What about placecing the login form in your layout page/class and surround it by a <t:if test="userLoggedIn"> in your layout tml and implement a "boolean isUserLoggedIn()" method in your layout class?

See T5 doc: 

Api docs/corelib/components/if 

User Guide/Layout Component


Jens



Sent from my iPhone

On 03.09.2012, at 11:11, fabs <lo...@gmail.com> wrote:

> Hello all.
> 
> My website has a login page, with a username and password field. However, I
> wish to show an inline login form on all pages when the user is not logged
> in, and submit the login request from any page to the main login page (to
> allow errors to be displayed in case login is unsuccessful). I am having
> trouble finding how to fit this use case into tapestry5.
> 
> Thank you for any advice. 
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-form-from-another-page-tp5715999.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

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


Re: Submitting a form from another page

Posted by fabs <lo...@gmail.com>.
Thanks for the advice. I have solved this by creating a login form component.
The login component attempts to log the user in, and if it fails, it uses
@InjectPage to inject the login page, and it sets the errors on the main
login form (like form.recordError("The username or password was
incorrect.");). The user can then continue to attempt to log in with the
main login page.

Thanks for the help.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-form-from-another-page-tp5715999p5716005.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Submitting a form from another page

Posted by Dmitry Gusev <dm...@gmail.com>.
Hi,

create new component with your login form and use it on all pages you want.

On Mon, Sep 3, 2012 at 1:11 PM, fabs <lo...@gmail.com> wrote:

> Hello all.
>
> My website has a login page, with a username and password field. However, I
> wish to show an inline login form on all pages when the user is not logged
> in, and submit the login request from any page to the main login page (to
> allow errors to be displayed in case login is unsuccessful). I am having
> trouble finding how to fit this use case into tapestry5.
>
> Thank you for any advice.
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Submitting-a-form-from-another-page-tp5715999.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com