Starting in release 2.0.3 (not released yet), there's a 
GenericLink component that creates a <a> element where 
you specify the URL.  You can connect its href parameter 
to the following property of your containing component:

public String getSubmitLinkURL()
{
  Form form = (Form)getComponent("form");

  return "javascript:document." + form.getName() 
+ ".submit();";
}

If you can't wait, you can do the same thing using an 
Any component:

<a jwcid="submitLink">Submit Form</a>

<component id="submitLink" type="Any">
  <static-binding name="element">a</static-binding>
  <binding name="href" property-path="submitLinkURL"/>
</component>

This seems like a lot of work, I guess ... since 
Tapestry doles out form names you are always assured 
that they are unique (regardless of the dynamic 
construction of the page) ... but with the expense that 
you have to ask Tapestry what the name of the form is!

This is the kind of thing that could easily be rolled up 
into a custom component.  It could even use the method 
Form.getForm(IRequestCycle) to find the Form which wraps 
it automatically, no parameter necessary.

--
[EMAIL PROTECTED]

http://tapestry.sf.net
> Hi All,
> 
> I have this simple question, please enlighten me:
> 
> I have a page with a Form on it.
> I need a link (<A>) to submit this form and go to next 
page,
> what is the best way to achieve this?
> 
> Thanks in advance!
> 
> 
> 
_________________________________________________________
________
> Get your FREE download of MSN Explorer at 
http://explorer.msn.com/intl.asp.
> 
> 
> 
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-
developer


--
[EMAIL PROTECTED]

http://tapestry.sf.net
> Hi All,
> 
> I have this simple question, please enlighten me:
> 
> I have a page with a Form on it.
> I need a link (<A>) to submit this form and go to next page,
> what is the best way to achieve this?
> 
> Thanks in advance!
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
> 
> 
> 
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to