You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jack Nuzbit <fn...@googlemail.com> on 2009/11/10 12:08:17 UTC

[T5.1] posting externally with t:form

Hi All,
I've got a rather complex form that I'd like to use the tapestry form
components to initialise but it needs to post externally.
Is there a way to do this with tapestry? Form components require a
surrounding t:form element which then overrides the action. I can't see any
way around this without some javascript hack or avoiding tapestry components
completely.

Thanks,

Jack

Re: [T5.1] posting externally with t:form

Posted by Ulrich Stärk <ul...@spielviel.de>.
Just do it in plain HTML.

<form method="post" action="http://some.other.site/action">
<input type="text" value="${someProperty}" />
<input type="submit" />
</form>

Uli

Am 10.11.2009 15:42 schrieb Jack Nuzbit:
> Thanks Massimo but I'm trying to do it the other way around (if I've
> understood you correctly).
> I am hosting the form on a tapestry site which I need to post to an external
> non-tapestry site. The problem is that in using tapestry components I can't
> set the action attribute of the form to post to this external site. The form
> component will override any action I define.
> 
> 
> On Tue, Nov 10, 2009 at 1:53 PM, Massimo Lusetti <ml...@gmail.com> wrote:
> 
>> On Tue, Nov 10, 2009 at 12:08 PM, Jack Nuzbit <fn...@googlemail.com>
>> wrote:
>>
>>> Hi All,
>>> I've got a rather complex form that I'd like to use the tapestry form
>>> components to initialise but it needs to post externally.
>>> Is there a way to do this with tapestry? Form components require a
>>> surrounding t:form element which then overrides the action. I can't see
>> any
>>> way around this without some javascript hack or avoiding tapestry
>> components
>>> completely.
>> If you want to use the form component simply code the t:formdata
>> parameter in your post request then set parameter as usual then you
>> can get T5 do the rest and you can process the form the T5-way.
>>
>> Till you don't change the tml of the form you're safe.
>>
>> Cheers
>> --
>> Massimo
>> http://meridio.blogspot.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: [T5.1] posting externally with t:form

Posted by Massimo Lusetti <ml...@gmail.com>.
On Tue, Nov 10, 2009 at 3:42 PM, Jack Nuzbit <fn...@googlemail.com> wrote:

> Thanks Massimo but I'm trying to do it the other way around (if I've
> understood you correctly).

Ops sorry you're right, I did misunderstood you. As others already
suggested you should do in plain HTML/JavaScript.

Cheers
-- 
Massimo
http://meridio.blogspot.com

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


Re: [T5.1] posting externally with t:form

Posted by Jack Nuzbit <fn...@googlemail.com>.
No worries, that's what I thought.

Probably from a tapestry perspective it doesn't make a lot of sense but it's
not an uncommon use case.
I would say it would be an improvement if I could override the default form
action and leverage tapestry form components in these situations.



On Tue, Nov 10, 2009 at 2:58 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Tue, 10 Nov 2009 12:42:25 -0200, Jack Nuzbit <fn...@googlemail.com>
> escreveu:
>
>
>  non-tapestry site. The problem is that in using tapestry components I
>> can't set the action attribute of the form to post to this external site.
>>
>
> You could use JavaScript for that as, from a Tapestry perspective, it
> doesn't make sense to post to other pages.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [T5.1] posting externally with t:form

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Tue, 10 Nov 2009 12:42:25 -0200, Jack Nuzbit <fn...@googlemail.com>  
escreveu:

> non-tapestry site. The problem is that in using tapestry components I  
> can't set the action attribute of the form to post to this external site.

You could use JavaScript for that as, from a Tapestry perspective, it  
doesn't make sense to post to other pages.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


Re: [T5.1] posting externally with t:form

Posted by Jack Nuzbit <fn...@googlemail.com>.
Thanks Massimo but I'm trying to do it the other way around (if I've
understood you correctly).
I am hosting the form on a tapestry site which I need to post to an external
non-tapestry site. The problem is that in using tapestry components I can't
set the action attribute of the form to post to this external site. The form
component will override any action I define.


On Tue, Nov 10, 2009 at 1:53 PM, Massimo Lusetti <ml...@gmail.com> wrote:

> On Tue, Nov 10, 2009 at 12:08 PM, Jack Nuzbit <fn...@googlemail.com>
> wrote:
>
> > Hi All,
> > I've got a rather complex form that I'd like to use the tapestry form
> > components to initialise but it needs to post externally.
> > Is there a way to do this with tapestry? Form components require a
> > surrounding t:form element which then overrides the action. I can't see
> any
> > way around this without some javascript hack or avoiding tapestry
> components
> > completely.
>
> If you want to use the form component simply code the t:formdata
> parameter in your post request then set parameter as usual then you
> can get T5 do the rest and you can process the form the T5-way.
>
> Till you don't change the tml of the form you're safe.
>
> Cheers
> --
> Massimo
> http://meridio.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [T5.1] posting externally with t:form

Posted by Massimo Lusetti <ml...@gmail.com>.
On Tue, Nov 10, 2009 at 12:08 PM, Jack Nuzbit <fn...@googlemail.com> wrote:

> Hi All,
> I've got a rather complex form that I'd like to use the tapestry form
> components to initialise but it needs to post externally.
> Is there a way to do this with tapestry? Form components require a
> surrounding t:form element which then overrides the action. I can't see any
> way around this without some javascript hack or avoiding tapestry components
> completely.

If you want to use the form component simply code the t:formdata
parameter in your post request then set parameter as usual then you
can get T5 do the rest and you can process the form the T5-way.

Till you don't change the tml of the form you're safe.

Cheers
-- 
Massimo
http://meridio.blogspot.com

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