You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Lorenz <ma...@siemens.com> on 2004/02/26 12:57:43 UTC

id for testing

I'm just starting to evaluate Tapestry, and I like what I see ;-)

I've got a question: For testing purposes (e.g. JWebUnit) I need some of my 
HTML tags instrumented with id=".." to access them by name, but all the 
jwcid=".." in the HTML template are consumed by Tapestry and do not appear in 
the resulting HTML. 

Is there a way to get some of the tags that are instrumented with the jwcid in 
the HTML template to be instrumented with the same id (but now called id="..") 
in the resulting HTML ? I plan to use only explicitly named components.

Thanks,
Martin


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


Re: id for testing

Posted by Martin Lorenz <ma...@siemens.com>.
Howard M. Lewis Ship <hlship <at> comcast.net> writes:
> Just put id="foo" into the HTML template. Virtually all components allow 
informal parameters, the id
> you provide will carry through into the rendered HTML.

What I wanted to do is to "reuse" the names from the jwcid to have ONE single 
id for a component (both for Tapestry and for testing) to save work, ease 
maintenance and reduce clutter in the HTML template as much as possible.

If there is no other way, I will have to do it as you propose.

Thanks,
Martin





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


Re: id for testing

Posted by Harish Krishnaswamy <hk...@comcast.net>.

Erik Hatcher wrote:

> On Feb 26, 2004, at 8:56 AM, Howard M. Lewis Ship wrote:
>
>> Just put id="foo" into the HTML template. Virtually all components 
>> allow informal parameters, the id
>> you provide will carry through into the rendered HTML.
>
>
> Is there a way to get the Tapestry generated name?  I looked into this 
> a bit and it seems it is impossible for a field to get this name 
> without breaking something (i.e. that method can only be called one) - 
> right??

The anyformComponent.getName() should get you the name. Its the 
form.getElementId() that can be called only once.

>
> I would like to generate id="..." attributes on fields using their 
> name, and tie that id to HTML <label for="..."> attributes.  The 
> <label> element is great for accessibility and such, and it would be 
> nice if Tapestry supported the capability of doing this somehow.  It 
> would actually be nice if Tapestry had built-in facilities for putting 
> the id onto fields, and allowing other related components (like 
> FieldLabel) to retrieve it.
>
> Thoughts?
>
>     Erik
>
>>
>> -- 
>> Howard M. Lewis Ship
>> Independent J2EE / Open-Source Java Consultant
>> Creator, Tapestry: Java Web Components
>> http://howardlewisship.com
>>
>>
>>> -----Original Message-----
>>> From: news [mailto:news@sea.gmane.org] On Behalf Of Martin Lorenz
>>> Sent: Thursday, February 26, 2004 6:58 AM
>>> To: tapestry-user@jakarta.apache.org
>>> Subject: id for testing
>>>
>>>
>>> I'm just starting to evaluate Tapestry, and I like what I see ;-)
>>>
>>> I've got a question: For testing purposes (e.g. JWebUnit) I
>>> need some of my
>>> HTML tags instrumented with id=".." to access them by name,
>>> but all the
>>> jwcid=".." in the HTML template are consumed by Tapestry and
>>> do not appear in
>>> the resulting HTML.
>>>
>>> Is there a way to get some of the tags that are instrumented
>>> with the jwcid in
>>> the HTML template to be instrumented with the same id (but
>>> now called id="..")
>>> in the resulting HTML ? I plan to use only explicitly named
>>> components.
>>>
>>> Thanks,
>>> Martin
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>
>
> ---------------------------------------------------------------------
> 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


RE: id for testing

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
It's the same problem that occurs with FieldLabel and ValidField; the FieldLabel renders first,
before the ValidField gets it element id from the Form.

Hm.

Perhaps the way to defuse these problems is:

Let the FieldLabel (which in Western/latin languages, will typically be rendered FIRST before the
ValidField) invoke IForm.getElementId().  The ValidField can be connected to the FieldLabel and get
the elementId from it!

In non-Western/latin languages, such as Japanese, where the ValidField renders first and the
FieldLabel second, you don't make the connection ... and the ValidField does what it does today
(gets the elementId from the Form).

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
> Sent: Thursday, February 26, 2004 10:07 AM
> To: Tapestry users
> Subject: Re: id for testing
> 
> 
> On Feb 26, 2004, at 8:56 AM, Howard M. Lewis Ship wrote:
> > Just put id="foo" into the HTML template. Virtually all components 
> > allow informal parameters, the id
> > you provide will carry through into the rendered HTML.
> 
> Is there a way to get the Tapestry generated name?  I looked 
> into this 
> a bit and it seems it is impossible for a field to get this name 
> without breaking something (i.e. that method can only be 
> called one) - 
> right??
> 
> I would like to generate id="..." attributes on fields using their 
> name, and tie that id to HTML <label for="..."> attributes.  The 
> <label> element is great for accessibility and such, and it would be 
> nice if Tapestry supported the capability of doing this somehow.  It 
> would actually be nice if Tapestry had built-in facilities 
> for putting 
> the id onto fields, and allowing other related components (like 
> FieldLabel) to retrieve it.
> 
> Thoughts?
> 
> 	Erik
> 
> >
> > --
> > Howard M. Lewis Ship
> > Independent J2EE / Open-Source Java Consultant
> > Creator, Tapestry: Java Web Components
> > http://howardlewisship.com
> >
> >
> >> -----Original Message-----
> >> From: news [mailto:news@sea.gmane.org] On Behalf Of Martin Lorenz
> >> Sent: Thursday, February 26, 2004 6:58 AM
> >> To: tapestry-user@jakarta.apache.org
> >> Subject: id for testing
> >>
> >>
> >> I'm just starting to evaluate Tapestry, and I like what I see ;-)
> >>
> >> I've got a question: For testing purposes (e.g. JWebUnit) I
> >> need some of my
> >> HTML tags instrumented with id=".." to access them by name,
> >> but all the
> >> jwcid=".." in the HTML template are consumed by Tapestry and
> >> do not appear in
> >> the resulting HTML.
> >>
> >> Is there a way to get some of the tags that are instrumented
> >> with the jwcid in
> >> the HTML template to be instrumented with the same id (but
> >> now called id="..")
> >> in the resulting HTML ? I plan to use only explicitly named
> >> components.
> >>
> >> Thanks,
> >> Martin
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> 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
> 
> 
> ---------------------------------------------------------------------
> 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


Re: id for testing

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 26, 2004, at 8:56 AM, Howard M. Lewis Ship wrote:
> Just put id="foo" into the HTML template. Virtually all components 
> allow informal parameters, the id
> you provide will carry through into the rendered HTML.

Is there a way to get the Tapestry generated name?  I looked into this 
a bit and it seems it is impossible for a field to get this name 
without breaking something (i.e. that method can only be called one) - 
right??

I would like to generate id="..." attributes on fields using their 
name, and tie that id to HTML <label for="..."> attributes.  The 
<label> element is great for accessibility and such, and it would be 
nice if Tapestry supported the capability of doing this somehow.  It 
would actually be nice if Tapestry had built-in facilities for putting 
the id onto fields, and allowing other related components (like 
FieldLabel) to retrieve it.

Thoughts?

	Erik

>
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Tapestry: Java Web Components
> http://howardlewisship.com
>
>
>> -----Original Message-----
>> From: news [mailto:news@sea.gmane.org] On Behalf Of Martin Lorenz
>> Sent: Thursday, February 26, 2004 6:58 AM
>> To: tapestry-user@jakarta.apache.org
>> Subject: id for testing
>>
>>
>> I'm just starting to evaluate Tapestry, and I like what I see ;-)
>>
>> I've got a question: For testing purposes (e.g. JWebUnit) I
>> need some of my
>> HTML tags instrumented with id=".." to access them by name,
>> but all the
>> jwcid=".." in the HTML template are consumed by Tapestry and
>> do not appear in
>> the resulting HTML.
>>
>> Is there a way to get some of the tags that are instrumented
>> with the jwcid in
>> the HTML template to be instrumented with the same id (but
>> now called id="..")
>> in the resulting HTML ? I plan to use only explicitly named
>> components.
>>
>> Thanks,
>> Martin
>>
>>
>> ---------------------------------------------------------------------
>> 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


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


RE: id for testing

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Just put id="foo" into the HTML template. Virtually all components allow informal parameters, the id
you provide will carry through into the rendered HTML.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Martin Lorenz
> Sent: Thursday, February 26, 2004 6:58 AM
> To: tapestry-user@jakarta.apache.org
> Subject: id for testing
> 
> 
> I'm just starting to evaluate Tapestry, and I like what I see ;-)
> 
> I've got a question: For testing purposes (e.g. JWebUnit) I 
> need some of my 
> HTML tags instrumented with id=".." to access them by name, 
> but all the 
> jwcid=".." in the HTML template are consumed by Tapestry and 
> do not appear in 
> the resulting HTML. 
> 
> Is there a way to get some of the tags that are instrumented 
> with the jwcid in 
> the HTML template to be instrumented with the same id (but 
> now called id="..") 
> in the resulting HTML ? I plan to use only explicitly named 
> components.
> 
> Thanks,
> Martin
> 
> 
> ---------------------------------------------------------------------
> 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