You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by David Diaz <d...@viddiaz.com> on 2016/12/08 23:22:08 UTC

Submit form without t:form component

Hi guys,

I was wondering if there was any way to submit a form without having a
t:form component and retrieve the data being sent? (e.g ideally a map would
be accessible and I could just retrieve that data).

I need to support this functionality (dynamic forms) and currently I'm
doing it by converting it to a JSON object and then sending the JSON object
to the server in an event - I would rather not have to have my forms rely
on Javascript to function.

Thanks,
David.

Re: Submit form without t:form component

Posted by David Diaz <d...@viddiaz.com>.
Awesome! Thank you very much :)

On Sat, Dec 10, 2016 at 12:13 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Or use an event URL, created through @Inject'ing ComponentResources and
> using its createEventLink() method.
>
>
>
> On Fri, Dec 9, 2016 at 11:11 AM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
> > Another option would be to have a pure HTML form (no usage of the Form
> > component) have its action attribute pointing to a Tapestry page URL (you
> > can get it using PageRenderLinkSource) and use the Request methods to get
> > the query parameters.
> >
> > On Fri, Dec 9, 2016 at 11:09 AM, Thiago H. de Paula Figueiredo <
> > thiagohp@gmail.com> wrote:
> >
> >> Hi!
> >>
> >> You can use a Form component, so you can handle its submission through
> an
> >> onSuccess*() method in usual Tapestry fashion, and use pure HTML fields
> >> (i.e. not using the Tapestry form field components), @Inject Request and
> >> use Request.getParameter*() methods to get its values and
> >> Request.getParameterNames() to get the query parameter names.
> >>
> >> On Thu, Dec 8, 2016 at 9:22 PM, David Diaz <d...@viddiaz.com> wrote:
> >>
> >>> Hi guys,
> >>>
> >>> I was wondering if there was any way to submit a form without having a
> >>> t:form component and retrieve the data being sent? (e.g ideally a map
> >>> would
> >>> be accessible and I could just retrieve that data).
> >>>
> >>> I need to support this functionality (dynamic forms) and currently I'm
> >>> doing it by converting it to a JSON object and then sending the JSON
> >>> object
> >>> to the server in an event - I would rather not have to have my forms
> rely
> >>> on Javascript to function.
> >>>
> >>> Thanks,
> >>> David.
> >>>
> >>
> >>
> >>
> >> --
> >> Thiago
> >>
> >
> >
> >
> > --
> > Thiago
> >
>
>
>
> --
> Thiago
>

Re: Submit form without t:form component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Or use an event URL, created through @Inject'ing ComponentResources and
using its createEventLink() method.



On Fri, Dec 9, 2016 at 11:11 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Another option would be to have a pure HTML form (no usage of the Form
> component) have its action attribute pointing to a Tapestry page URL (you
> can get it using PageRenderLinkSource) and use the Request methods to get
> the query parameters.
>
> On Fri, Dec 9, 2016 at 11:09 AM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> Hi!
>>
>> You can use a Form component, so you can handle its submission through an
>> onSuccess*() method in usual Tapestry fashion, and use pure HTML fields
>> (i.e. not using the Tapestry form field components), @Inject Request and
>> use Request.getParameter*() methods to get its values and
>> Request.getParameterNames() to get the query parameter names.
>>
>> On Thu, Dec 8, 2016 at 9:22 PM, David Diaz <d...@viddiaz.com> wrote:
>>
>>> Hi guys,
>>>
>>> I was wondering if there was any way to submit a form without having a
>>> t:form component and retrieve the data being sent? (e.g ideally a map
>>> would
>>> be accessible and I could just retrieve that data).
>>>
>>> I need to support this functionality (dynamic forms) and currently I'm
>>> doing it by converting it to a JSON object and then sending the JSON
>>> object
>>> to the server in an event - I would rather not have to have my forms rely
>>> on Javascript to function.
>>>
>>> Thanks,
>>> David.
>>>
>>
>>
>>
>> --
>> Thiago
>>
>
>
>
> --
> Thiago
>



-- 
Thiago

Re: Submit form without t:form component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Another option would be to have a pure HTML form (no usage of the Form
component) have its action attribute pointing to a Tapestry page URL (you
can get it using PageRenderLinkSource) and use the Request methods to get
the query parameters.

On Fri, Dec 9, 2016 at 11:09 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Hi!
>
> You can use a Form component, so you can handle its submission through an
> onSuccess*() method in usual Tapestry fashion, and use pure HTML fields
> (i.e. not using the Tapestry form field components), @Inject Request and
> use Request.getParameter*() methods to get its values and
> Request.getParameterNames() to get the query parameter names.
>
> On Thu, Dec 8, 2016 at 9:22 PM, David Diaz <d...@viddiaz.com> wrote:
>
>> Hi guys,
>>
>> I was wondering if there was any way to submit a form without having a
>> t:form component and retrieve the data being sent? (e.g ideally a map
>> would
>> be accessible and I could just retrieve that data).
>>
>> I need to support this functionality (dynamic forms) and currently I'm
>> doing it by converting it to a JSON object and then sending the JSON
>> object
>> to the server in an event - I would rather not have to have my forms rely
>> on Javascript to function.
>>
>> Thanks,
>> David.
>>
>
>
>
> --
> Thiago
>



-- 
Thiago

Re: Submit form without t:form component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Hi!

You can use a Form component, so you can handle its submission through an
onSuccess*() method in usual Tapestry fashion, and use pure HTML fields
(i.e. not using the Tapestry form field components), @Inject Request and
use Request.getParameter*() methods to get its values and
Request.getParameterNames() to get the query parameter names.

On Thu, Dec 8, 2016 at 9:22 PM, David Diaz <d...@viddiaz.com> wrote:

> Hi guys,
>
> I was wondering if there was any way to submit a form without having a
> t:form component and retrieve the data being sent? (e.g ideally a map would
> be accessible and I could just retrieve that data).
>
> I need to support this functionality (dynamic forms) and currently I'm
> doing it by converting it to a JSON object and then sending the JSON object
> to the server in an event - I would rather not have to have my forms rely
> on Javascript to function.
>
> Thanks,
> David.
>



-- 
Thiago

Re: Submit form without t:form component

Posted by Barry Books <tr...@gmail.com>.
The Tapestry components such as input expect to be inside a form component
but if you use just HTML and submit the form with a GET I suspect it would
work just like any other link.

Re: Submit form without t:form component

Posted by David Diaz <d...@viddiaz.com>.
Hi Lance,

Sorry, I realise my message wasn't as clear.

I don't mean submit the form on a clientside event - I mean I want to
inject a form onto the page without using a t:form component (so it would
be just like a normal HTML form) and then be able to submit it to the
server and be able to get a Map<> of the keys & values that the user
submitted to the server. Using a t:form isn't possible for this purpose
because you need to declare the exact fields that are going to be included
in the form, which doesn't fit my purpose.

Thanks,
David.

On Fri, Dec 9, 2016 at 10:34 AM, Lance Java <la...@googlemail.com>
wrote:

> Perhaps the observe mixin could help you?
> http://t5stitch-lazan.rhcloud.com/observedemo
>
> On 8 Dec 2016 11:22 p.m., "David Diaz" <d...@viddiaz.com> wrote:
>
> > Hi guys,
> >
> > I was wondering if there was any way to submit a form without having a
> > t:form component and retrieve the data being sent? (e.g ideally a map
> would
> > be accessible and I could just retrieve that data).
> >
> > I need to support this functionality (dynamic forms) and currently I'm
> > doing it by converting it to a JSON object and then sending the JSON
> object
> > to the server in an event - I would rather not have to have my forms rely
> > on Javascript to function.
> >
> > Thanks,
> > David.
> >
>

Re: Submit form without t:form component

Posted by Lance Java <la...@googlemail.com>.
Perhaps the observe mixin could help you?
http://t5stitch-lazan.rhcloud.com/observedemo

On 8 Dec 2016 11:22 p.m., "David Diaz" <d...@viddiaz.com> wrote:

> Hi guys,
>
> I was wondering if there was any way to submit a form without having a
> t:form component and retrieve the data being sent? (e.g ideally a map would
> be accessible and I could just retrieve that data).
>
> I need to support this functionality (dynamic forms) and currently I'm
> doing it by converting it to a JSON object and then sending the JSON object
> to the server in an event - I would rather not have to have my forms rely
> on Javascript to function.
>
> Thanks,
> David.
>