You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gabriel Falkenberg <ga...@gmail.com> on 2004/06/29 01:50:16 UTC

Having forms on external pages

I am having trouble getting forms on pages implementing IExternalPage
to work. Is the use of forms on these pages discouraged or is there a
way to make them work like on normal pages?

I'd like to be able to just put a form on an external page and like on
normal pages the user should be taken back to the same page when the
form is submitted.

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


Re: Having forms on external pages

Posted by Richard Kirby <rb...@capdm.com>.
Another solution is to stick the id inside a hidden component in the 
form. That way, when the form is submitted you will automatically have 
the object id available for redisplaying the page. No need then for a 
persistent page property.

Richard.

On 1 Jul 2004, at 11:53, Gabriel Falkenberg wrote:

> Let's see if I can clarify my question and the solution I've chosen. I
> want to know if my solution is correct.
>
> There are pages on the site I'm making that display different objects
> from a database (users, articles, link collections, forums). They all
> implement the IExternalInterface and require the ID of an object as
> their only parameter. Some of the pages have forms that are validating
> (the user page contains a form to send private messages, the forum
> thread page contains a form to write forum posts etc).
>
> The user gets to these page by clicking links on the rest of the web
> page, external links that contain the right parameter. The forms are
> empty when the pages are first viewed. If a form is submitted with
> input that is wrong the same page should be shown again with an
> error-message and the form should contain the erroneous input (like
> most forms do).
>
> The problem is that when the user hits the submit button, and submits
> a form that is erroneous, the user is taken back to the same page but
> the parameter with the ID is not sent again. This makes it impossible
> to show the same object again.
>
> To solve this I have made the objects page property persistent so that
> no parameter is needed except for the first view of the page.
>
> My question is if this is the correct way of using persistent page
> properties. I'm so stuck in the PHP-way of thinking that I'm not
> really sure (even though I have read the book).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


Re: Having forms on external pages

Posted by Gabriel Falkenberg <ga...@gmail.com>.
Let's see if I can clarify my question and the solution I've chosen. I
want to know if my solution is correct.

There are pages on the site I'm making that display different objects
from a database (users, articles, link collections, forums). They all
implement the IExternalInterface and require the ID of an object as
their only parameter. Some of the pages have forms that are validating
(the user page contains a form to send private messages, the forum
thread page contains a form to write forum posts etc).

The user gets to these page by clicking links on the rest of the web
page, external links that contain the right parameter. The forms are
empty when the pages are first viewed. If a form is submitted with
input that is wrong the same page should be shown again with an
error-message and the form should contain the erroneous input (like
most forms do).

The problem is that when the user hits the submit button, and submits
a form that is erroneous, the user is taken back to the same page but
the parameter with the ID is not sent again. This makes it impossible
to show the same object again.

To solve this I have made the objects page property persistent so that
no parameter is needed except for the first view of the page.

My question is if this is the correct way of using persistent page
properties. I'm so stuck in the PHP-way of thinking that I'm not
really sure (even though I have read the book).

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


Re: Having forms on external pages

Posted by Howard Lewis Ship <hl...@gmail.com>.
I'm sorry, I can't figure out what your issue is.

http://jakarta.apache.org/tapestry/problems.html

On Tue, 29 Jun 2004 02:05:46 +0200, Gabriel Falkenberg
<ga...@gmail.com> wrote:
> 
> Hmmm, I think my mind might still be left in the PHP-query string
> world and maybe my grasp of persistent page properties isn't what it
> should be but I think I might understand how to do what I want now.
> 
> Lets say I have a page presenting a user on a community web page and
> on that page there is a form to send private messages to that very
> user. The page presenting the user is external and takes the user's id
> as its only parameter. Is the "correct" way to handle this to set the
> user property in the activateExternalPage method and let the user
> property be persistent so that subsequent views of the page, such as
> when the form is submitted, still show the correct user without having
> to run the code in the activateExternalPage method again?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

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


Re: Having forms on external pages

Posted by Gabriel Falkenberg <ga...@gmail.com>.
Hmmm, I think my mind might still be left in the PHP-query string
world and maybe my grasp of persistent page properties isn't what it
should be but I think I might understand how to do what I want now.

Lets say I have a page presenting a user on a community web page and
on that page there is a form to send private messages to that very
user. The page presenting the user is external and takes the user's id
as its only parameter. Is the "correct" way to handle this to set the
user property in the activateExternalPage method and let the user
property be persistent so that subsequent views of the page, such as
when the form is submitted, still show the correct user without having
to run the code in the activateExternalPage method again?

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