You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Eng <be...@jetpen.com> on 2005/04/04 22:24:54 UTC

Tapestry Form component name

Has anyone been able to set the HTML form name explicitly? I am
encountering what appears to be a bug in the Form component.

http://issues.apache.org/jira/browse/TAPESTRY-293

Not being able to explicitly name the HTML form is a major
inconvenience for jWebUnit testing.

Ben

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


Re: Component name prefixes (was Tapestry Form component name)

Posted by Ben Eng <be...@jetpen.com>.
A unique component name is used to identify each component instance on
the page.

For example, I might add a getter on my page class to return the path
to my input field component, so that some JavaScript code can populate
the field.

    public String getSiteField()
    {
        IForm searchForm = (IForm) getComponent( "searchForm" );
        IFormComponent siteField = (IFormComponent) getComponent( "inputSite" );
        String field = searchForm.getName() + "." + siteField.getName();
        return field;
    }

This is also useful, when you need to assemble multiple components
onto the page, and wire them up to work with eachother. For example, a
result set browser and a pager control would work together, so you'd
need a way to identify the browser, so that it can be passed to the
pager.

Those are reasons related to coding the application itself. There are
also other reasons that support clients of the application. For
example, I need to be able to explicitly identify the HTML forms on
the page, so that jWebUnit can control them during a test. I need to
be able to explicitly identify the input fields, submit buttons, and
links for the same reason.

Ben


On Tue, Apr 05, 2005 at 12:49:25PM +0900, David Leangen wrote:
> 
> This leads me to a question that I've been a bit curious about...
> 
> Would somebody mind kindly explaining the mechanism of having a prefix, such
> as the form_name@Form below?
> 
> Why is this legal? What does the prefix "form_name" mean? How can it be
> reused? Why is this useful?
> 
> Or, alternatively, if there is already someplace where this is explained
> (including in TIA), I'd love to get a reference.
> 
> 
> Thanks!
> Dave
> 
> 
> 
> > -----Original Message-----
> > From: stephen smithstone [mailto:skullboxhouse@lchost.co.uk]
> > Sent: 5 April 2005 05:32
> > To: Tapestry users
> > Subject: Re: Tapestry Form component name
> >
> >
> > i can't remember exactly but in the jwcid add the name before the @Form
> > so something like jwcid="form_name@Form" and i always add
> > name="form_name" and id="form_name" just incase
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

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


Component name prefixes (was Tapestry Form component name)

Posted by David Leangen <dl...@canada.com>.
This leads me to a question that I've been a bit curious about...

Would somebody mind kindly explaining the mechanism of having a prefix, such
as the form_name@Form below?

Why is this legal? What does the prefix "form_name" mean? How can it be
reused? Why is this useful?

Or, alternatively, if there is already someplace where this is explained
(including in TIA), I'd love to get a reference.


Thanks!
Dave



> -----Original Message-----
> From: stephen smithstone [mailto:skullboxhouse@lchost.co.uk]
> Sent: 5 April 2005 05:32
> To: Tapestry users
> Subject: Re: Tapestry Form component name
>
>
> i can't remember exactly but in the jwcid add the name before the @Form
> so something like jwcid="form_name@Form" and i always add
> name="form_name" and id="form_name" just incase



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


Re: Tapestry Form component name

Posted by stephen smithstone <sk...@lchost.co.uk>.
i can't remember exactly but in the jwcid add the name before the @Form 
so something like jwcid="form_name@Form" and i always add 
name="form_name" and id="form_name" just incase


On 4 Apr 2005, at 21:24, Ben Eng wrote:

> Has anyone been able to set the HTML form name explicitly? I am
> encountering what appears to be a bug in the Form component.
>
> http://issues.apache.org/jira/browse/TAPESTRY-293
>
> Not being able to explicitly name the HTML form is a major
> inconvenience for jWebUnit testing.
>
> Ben
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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