Sorry - just read the end of the question! Not sure how you could
trigger a submit, as by the time your component code is run it'll be
half-way through a rewind. Nothing to stop you getting hold of the
containing form's listener (if it had one) I guess, and triggering it
using the invokeListener method, but you'd want to be careful to check
that that wasn't how your component came to be rewinding in the first
place. 

-----Original Message-----
From: Joe Trewin [mailto:[EMAIL PROTECTED] 
Sent: 31 October 2005 18:24
To: Tapestry users
Subject: RE: Checking if component is in a Form inside the components
code

Yes it is (assuming Tap 4.0 here, but probably a similar method for
3.0). I use something along the lines of:

    IForm form = (IForm)
cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE);
    boolean inForm = (form != null);

    if (inForm) {
        // ... do something
    } else {
        // ... do something else
    }

If you need mor elaboration, or have trouble, try checking out the
source code for the For component
(/framework/src/java/org/apache/tapestry/components/ForBean.java) in the
Tapestry distribution.

Cheers,
Joe

-----Original Message-----
From: Tony De Keizer [mailto:[EMAIL PROTECTED]
Sent: 29 October 2005 03:16
To: Tapestry users
Subject: Checking if component is in a Form inside the components code

Is it possible for component java code to check if it is imbedded inside
a form component and if so trigger a form submit ?

Regards
========================================
Tony De Keizer


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.6/151 - Release Date:
28/10/2005

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to