You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2007/12/08 16:02:40 UTC

T5: multiple forms

Hi,

I have two forms in a page, and I need to determine which form trigger the
onSuccess, tried following code, but does not work, any idea? Thanks,
A.C.

String onSuccessFromSubmit2() {
        System.out.println("submit1");
        return null;
 }

 String onSuccessFromSubmit2() {
        System.out.println("submit2");
        return null;
 }

<t:form t:id="searchForm1" t:clientValidation="false">
    <input t:type="submit" name="Submit1" t:id="Submit1" value="Search Now"
/><br />
 </t:form>
   
<t:form t:id="searchForm2" t:clientValidation="false">
    <input t:type="submit" name="Submit2" t:id="Submit2" value="Search Now"
/><br />
</t:form>
-- 
View this message in context: http://www.nabble.com/T5%3A-multiple-forms-tf4967253.html#a14229085
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: T5: multiple forms

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
It's all in the Component Reference - and Form emits quite a few events:
http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentsform

-Filip

Ted Steen skrev:
> value="validate".
> 
> but I cant find any documentation on it?
> The component event mechanism seems poorly documented.
> 
> This is all I find on the site,
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/event.html
> 
> 
> 2007/12/8, Penyihir Kecil <pe...@gmail.com>:
>> @OnEvent(component="searchForm 1", value="success") ---> what else value can
>> be filled beside "success" ??
>>
>> On Dec 8, 2007 10:51 PM, Ted Steen <te...@gmail.com> wrote:
>>
>>> It should be onSuccessFromSearchForm1() and onSuccessFromSearchForm2()
>>> as it is the form, not the button that succeeds.
>>>
>>> alternatively
>>>
>>> @OnEvent(component="searchForm1", value="success")
>>> public void search1()
>>> {
>>> }
>>>
>>> 2007/12/8, Angelo Chen <an...@yahoo.com.hk>:
>>>> Hi,
>>>>
>>>> I have two forms in a page, and I need to determine which form trigger
>>> the
>>>> onSuccess, tried following code, but does not work, any idea? Thanks,
>>>> A.C.
>>>>
>>>> String onSuccessFromSubmit2() {
>>>>         System.out.println("submit1");
>>>>         return null;
>>>>  }
>>>>
>>>>  String onSuccessFromSubmit2() {
>>>>         System.out.println("submit2");
>>>>         return null;
>>>>  }
>>>>
>>>> <t:form t:id="searchForm1" t:clientValidation="false">
>>>>     <input t:type="submit" name="Submit1" t:id="Submit1" value="Search
>>> Now"
>>>> /><br />
>>>>  </t:form>
>>>>
>>>> <t:form t:id="searchForm2" t:clientValidation="false">
>>>>     <input t:type="submit" name="Submit2" t:id="Submit2" value="Search
>>> Now"
>>>> /><br />
>>>> </t:form>
>>>> --
>>>> View this message in context:
>>> http://www.nabble.com/T5%3A-multiple-forms-tf4967253.html#a14229085
>>>> 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
>>>>
>>>>
>>>
>>> --
>>> /ted
>>>
>>> ---------------------------------------------------------------------
>>> 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: multiple forms

Posted by Ted Steen <te...@gmail.com>.
value="validate".

but I cant find any documentation on it?
The component event mechanism seems poorly documented.

This is all I find on the site,
http://tapestry.apache.org/tapestry5/tapestry-core/guide/event.html


2007/12/8, Penyihir Kecil <pe...@gmail.com>:
> @OnEvent(component="searchForm 1", value="success") ---> what else value can
> be filled beside "success" ??
>
> On Dec 8, 2007 10:51 PM, Ted Steen <te...@gmail.com> wrote:
>
> > It should be onSuccessFromSearchForm1() and onSuccessFromSearchForm2()
> > as it is the form, not the button that succeeds.
> >
> > alternatively
> >
> > @OnEvent(component="searchForm1", value="success")
> > public void search1()
> > {
> > }
> >
> > 2007/12/8, Angelo Chen <an...@yahoo.com.hk>:
> > >
> > > Hi,
> > >
> > > I have two forms in a page, and I need to determine which form trigger
> > the
> > > onSuccess, tried following code, but does not work, any idea? Thanks,
> > > A.C.
> > >
> > > String onSuccessFromSubmit2() {
> > >         System.out.println("submit1");
> > >         return null;
> > >  }
> > >
> > >  String onSuccessFromSubmit2() {
> > >         System.out.println("submit2");
> > >         return null;
> > >  }
> > >
> > > <t:form t:id="searchForm1" t:clientValidation="false">
> > >     <input t:type="submit" name="Submit1" t:id="Submit1" value="Search
> > Now"
> > > /><br />
> > >  </t:form>
> > >
> > > <t:form t:id="searchForm2" t:clientValidation="false">
> > >     <input t:type="submit" name="Submit2" t:id="Submit2" value="Search
> > Now"
> > > /><br />
> > > </t:form>
> > > --
> > > View this message in context:
> > http://www.nabble.com/T5%3A-multiple-forms-tf4967253.html#a14229085
> > > 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
> > >
> > >
> >
> >
> > --
> > /ted
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>


-- 
/ted

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


Re: T5: multiple forms

Posted by Penyihir Kecil <pe...@gmail.com>.
@OnEvent(component="searchForm 1", value="success") ---> what else value can
be filled beside "success" ??

On Dec 8, 2007 10:51 PM, Ted Steen <te...@gmail.com> wrote:

> It should be onSuccessFromSearchForm1() and onSuccessFromSearchForm2()
> as it is the form, not the button that succeeds.
>
> alternatively
>
> @OnEvent(component="searchForm1", value="success")
> public void search1()
> {
> }
>
> 2007/12/8, Angelo Chen <an...@yahoo.com.hk>:
> >
> > Hi,
> >
> > I have two forms in a page, and I need to determine which form trigger
> the
> > onSuccess, tried following code, but does not work, any idea? Thanks,
> > A.C.
> >
> > String onSuccessFromSubmit2() {
> >         System.out.println("submit1");
> >         return null;
> >  }
> >
> >  String onSuccessFromSubmit2() {
> >         System.out.println("submit2");
> >         return null;
> >  }
> >
> > <t:form t:id="searchForm1" t:clientValidation="false">
> >     <input t:type="submit" name="Submit1" t:id="Submit1" value="Search
> Now"
> > /><br />
> >  </t:form>
> >
> > <t:form t:id="searchForm2" t:clientValidation="false">
> >     <input t:type="submit" name="Submit2" t:id="Submit2" value="Search
> Now"
> > /><br />
> > </t:form>
> > --
> > View this message in context:
> http://www.nabble.com/T5%3A-multiple-forms-tf4967253.html#a14229085
> > 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
> >
> >
>
>
> --
> /ted
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: multiple forms

Posted by Ted Steen <te...@gmail.com>.
It should be onSuccessFromSearchForm1() and onSuccessFromSearchForm2()
as it is the form, not the button that succeeds.

alternatively

@OnEvent(component="searchForm1", value="success")
public void search1()
{
}

2007/12/8, Angelo Chen <an...@yahoo.com.hk>:
>
> Hi,
>
> I have two forms in a page, and I need to determine which form trigger the
> onSuccess, tried following code, but does not work, any idea? Thanks,
> A.C.
>
> String onSuccessFromSubmit2() {
>         System.out.println("submit1");
>         return null;
>  }
>
>  String onSuccessFromSubmit2() {
>         System.out.println("submit2");
>         return null;
>  }
>
> <t:form t:id="searchForm1" t:clientValidation="false">
>     <input t:type="submit" name="Submit1" t:id="Submit1" value="Search Now"
> /><br />
>  </t:form>
>
> <t:form t:id="searchForm2" t:clientValidation="false">
>     <input t:type="submit" name="Submit2" t:id="Submit2" value="Search Now"
> /><br />
> </t:form>
> --
> View this message in context: http://www.nabble.com/T5%3A-multiple-forms-tf4967253.html#a14229085
> 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
>
>


-- 
/ted

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