You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julian Wood <wo...@ucalgary.ca> on 2008/04/22 19:31:08 UTC

[T5] Colons in element ids?

5.0.12-SNAP

If I make a form and put a form label combo in it:

<form t:type="Form">
  <div>
   <label t:type="Label" t:for="username" />
   <input t:type="TextField" t:id="username" type="text"  
maxlength="15"/>
  </div>
</form>

It is rendered out like this:

<label for="username" id="username:label">Username:</label>
<input id="username" maxlength="15" name="username" type="text">

How can I target the the label id with a css rule?

#username:label {
	color: red;
}

is illegal - well it is a pseudo-class, like a:hover. I realize there  
are other ways to get around this - my point is shouldn't tapestry be  
using something other than a colon in the identifier?

J

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


Re: [T5] Colons in element ids?

Posted by Andreas Andreou <an...@gmail.com>.
AFAIK, jsf uses colons

On Tue, Apr 22, 2008 at 10:17 PM, Julian Wood <wo...@ucalgary.ca> wrote:
> https://issues.apache.org/jira/browse/TAPESTRY-2377
>
>  I checked a bunch of alternatives, and I think the best option is one or
> more hyphens. Every other char I tried either has a purpose or is ignored.
>
>  J
>
>
>
>  On Apr 22, 2008, at 11:42 AM, Howard Lewis Ship wrote:
>
>
> > That is a valid point. At the core of this issue is the way Tapestry
> > is responsible for doling out *unique* ids to elements of the page, as
> > the page is rendered. This is necessary because you may have nested
> > components that end up with conflicting ids very easily.
> >
> > The convention of appending a suffix, seperated by a colon, was taken
> > on because colons are not valid component id characters, so there's no
> > chance of conflict.
> >
> > We'll have to look into an alternative; perhaps "." will work, or "$".
> >
> > Please add an issue to JIRA.
> >
> > On Tue, Apr 22, 2008 at 10:31 AM, Julian Wood <wo...@ucalgary.ca> wrote:
> >
> > > 5.0.12-SNAP
> > >
> > > If I make a form and put a form label combo in it:
> > >
> > > <form t:type="Form">
> > >  <div>
> > >  <label t:type="Label" t:for="username" />
> > >  <input t:type="TextField" t:id="username" type="text" maxlength="15"/>
> > >  </div>
> > > </form>
> > >
> > > It is rendered out like this:
> > >
> > > <label for="username" id="username:label">Username:</label>
> > > <input id="username" maxlength="15" name="username" type="text">
> > >
> > > How can I target the the label id with a css rule?
> > >
> > > #username:label {
> > >       color: red;
> > > }
> > >
> > > is illegal - well it is a pseudo-class, like a:hover. I realize there
> are
> > > other ways to get around this - my point is shouldn't tapestry be using
> > > something other than a colon in the identifier?
> > >
> > > J
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > >
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator Apache Tapestry and Apache HiveMind
> >
> > ---------------------------------------------------------------------
> > 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
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


Re: [T5] Colons in element ids?

Posted by Julian Wood <wo...@ucalgary.ca>.
https://issues.apache.org/jira/browse/TAPESTRY-2377

I checked a bunch of alternatives, and I think the best option is one  
or more hyphens. Every other char I tried either has a purpose or is  
ignored.

J

On Apr 22, 2008, at 11:42 AM, Howard Lewis Ship wrote:

> That is a valid point. At the core of this issue is the way Tapestry
> is responsible for doling out *unique* ids to elements of the page, as
> the page is rendered. This is necessary because you may have nested
> components that end up with conflicting ids very easily.
>
> The convention of appending a suffix, seperated by a colon, was taken
> on because colons are not valid component id characters, so there's no
> chance of conflict.
>
> We'll have to look into an alternative; perhaps "." will work, or "$".
>
> Please add an issue to JIRA.
>
> On Tue, Apr 22, 2008 at 10:31 AM, Julian Wood <wo...@ucalgary.ca>  
> wrote:
>> 5.0.12-SNAP
>>
>> If I make a form and put a form label combo in it:
>>
>> <form t:type="Form">
>>  <div>
>>  <label t:type="Label" t:for="username" />
>>  <input t:type="TextField" t:id="username" type="text"  
>> maxlength="15"/>
>>  </div>
>> </form>
>>
>> It is rendered out like this:
>>
>> <label for="username" id="username:label">Username:</label>
>> <input id="username" maxlength="15" name="username" type="text">
>>
>> How can I target the the label id with a css rule?
>>
>> #username:label {
>>        color: red;
>> }
>>
>> is illegal - well it is a pseudo-class, like a:hover. I realize  
>> there are
>> other ways to get around this - my point is shouldn't tapestry be  
>> using
>> something other than a colon in the identifier?
>>
>> J
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> -- 
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> 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] Colons in element ids?

Posted by Howard Lewis Ship <hl...@gmail.com>.
That is a valid point. At the core of this issue is the way Tapestry
is responsible for doling out *unique* ids to elements of the page, as
the page is rendered. This is necessary because you may have nested
components that end up with conflicting ids very easily.

The convention of appending a suffix, seperated by a colon, was taken
on because colons are not valid component id characters, so there's no
chance of conflict.

We'll have to look into an alternative; perhaps "." will work, or "$".

Please add an issue to JIRA.

On Tue, Apr 22, 2008 at 10:31 AM, Julian Wood <wo...@ucalgary.ca> wrote:
> 5.0.12-SNAP
>
>  If I make a form and put a form label combo in it:
>
>  <form t:type="Form">
>   <div>
>   <label t:type="Label" t:for="username" />
>   <input t:type="TextField" t:id="username" type="text" maxlength="15"/>
>   </div>
>  </form>
>
>  It is rendered out like this:
>
>  <label for="username" id="username:label">Username:</label>
>  <input id="username" maxlength="15" name="username" type="text">
>
>  How can I target the the label id with a css rule?
>
>  #username:label {
>         color: red;
>  }
>
>  is illegal - well it is a pseudo-class, like a:hover. I realize there are
> other ways to get around this - my point is shouldn't tapestry be using
> something other than a colon in the identifier?
>
>  J
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: [T5] Colons in element ids?

Posted by Peter Beshai <pe...@gmail.com>.
You could just give the label an id or a class:

<form t:type="Form">
 <div>
 <label t:type="Label" t:for="username" id="username-label" />
 <input t:type="TextField" t:id="username" type="text" maxlength="15"/>
 </div>
</form>

and use #username-label

or

<form t:type="Form">
 <div>
 <label t:type="Label" t:for="username"  class="labelClass" />
 <input t:type="TextField" t:id="username" type="text" maxlength="15"/>
 </div>
</form>

and use label.labelClass

or even something like

<form t:type="Form" t:id="myform">
 <div>
 <label t:type="Label" t:for="username"/>
 <input t:type="TextField" t:id="username" type="text" maxlength="15"/>
 </div>
</form>

and use form#myform label


There are tons of ways! :-)

Peter Beshai

On Tue, Apr 22, 2008 at 1:31 PM, Julian Wood <wo...@ucalgary.ca> wrote:

> 5.0.12-SNAP
>
> If I make a form and put a form label combo in it:
>
> <form t:type="Form">
>  <div>
>  <label t:type="Label" t:for="username" />
>  <input t:type="TextField" t:id="username" type="text" maxlength="15"/>
>  </div>
> </form>
>
> It is rendered out like this:
>
> <label for="username" id="username:label">Username:</label>
> <input id="username" maxlength="15" name="username" type="text">
>
> How can I target the the label id with a css rule?
>
> #username:label {
>        color: red;
> }
>
> is illegal - well it is a pseudo-class, like a:hover. I realize there are
> other ways to get around this - my point is shouldn't tapestry be using
> something other than a colon in the identifier?
>
> J
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [T5] Colons in element ids?

Posted by Julian Wood <wo...@ucalgary.ca>.
Of course, IE7 doesn't recognize that escape character - I would  
imagine IE6 is the same - and so totally ignores the css rule. :-(

J

On Apr 22, 2008, at 2:05 PM, Julian Wood wrote:

> Sweet! That is a good solution.
>
> J
>
> On Apr 22, 2008, at 1:57 PM, Jason Lea wrote:
>
>> or you could try looking at the css spec... http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
>> and use the escape character \  :)
>>
>> example:
>>
>> <html>
>> <head>
>> <style type="text/css">
>>  #foo\:bar { color: red;}
>> </style>
>> </head>
>> <body>
>> <p id="foo:bar">fubar</p>
>> </body>
>> </html>
>>
>> Julian Wood wrote:
>>> 5.0.12-SNAP
>>>
>>> If I make a form and put a form label combo in it:
>>>
>>> <form t:type="Form">
>>> <div>
>>>  <label t:type="Label" t:for="username" />
>>>  <input t:type="TextField" t:id="username" type="text"   
>>> maxlength="15"/>
>>> </div>
>>> </form>
>>>
>>> It is rendered out like this:
>>>
>>> <label for="username" id="username:label">Username:</label>
>>> <input id="username" maxlength="15" name="username" type="text">
>>>
>>> How can I target the the label id with a css rule?
>>>
>>> #username:label {
>>> 	color: red;
>>> }
>>>
>>> is illegal - well it is a pseudo-class, like a:hover. I realize  
>>> there  are other ways to get around this - my point is shouldn't  
>>> tapestry be  using something other than a colon in the identifier?
>>>
>>> J
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>> -- 
>> Jason Lea
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>


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


Re: [T5] Colons in element ids?

Posted by Julian Wood <wo...@ucalgary.ca>.
Sweet! That is a good solution.

J

On Apr 22, 2008, at 1:57 PM, Jason Lea wrote:

> or you could try looking at the css spec... http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
> and use the escape character \  :)
>
> example:
>
> <html>
> <head>
> <style type="text/css">
>   #foo\:bar { color: red;}
> </style>
> </head>
> <body>
> <p id="foo:bar">fubar</p>
> </body>
> </html>
>
> Julian Wood wrote:
>> 5.0.12-SNAP
>>
>> If I make a form and put a form label combo in it:
>>
>> <form t:type="Form">
>>  <div>
>>   <label t:type="Label" t:for="username" />
>>   <input t:type="TextField" t:id="username" type="text"   
>> maxlength="15"/>
>>  </div>
>> </form>
>>
>> It is rendered out like this:
>>
>> <label for="username" id="username:label">Username:</label>
>> <input id="username" maxlength="15" name="username" type="text">
>>
>> How can I target the the label id with a css rule?
>>
>> #username:label {
>> 	color: red;
>> }
>>
>> is illegal - well it is a pseudo-class, like a:hover. I realize  
>> there  are other ways to get around this - my point is shouldn't  
>> tapestry be  using something other than a colon in the identifier?
>>
>> J
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> -- 
> Jason Lea
>
>
>
> ---------------------------------------------------------------------
> 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] Colons in element ids?

Posted by Jason Lea <ja...@kumachan.net.nz>.
or you could try looking at the css spec... 
http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
and use the escape character \  :)

example:

<html>
<head>
<style type="text/css">
    #foo\:bar { color: red;}
</style>
</head>
<body>
<p id="foo:bar">fubar</p>
</body>
</html>

Julian Wood wrote:
> 5.0.12-SNAP
>
> If I make a form and put a form label combo in it:
>
> <form t:type="Form">
>   <div>
>    <label t:type="Label" t:for="username" />
>    <input t:type="TextField" t:id="username" type="text"  
> maxlength="15"/>
>   </div>
> </form>
>
> It is rendered out like this:
>
> <label for="username" id="username:label">Username:</label>
> <input id="username" maxlength="15" name="username" type="text">
>
> How can I target the the label id with a css rule?
>
> #username:label {
> 	color: red;
> }
>
> is illegal - well it is a pseudo-class, like a:hover. I realize there  
> are other ways to get around this - my point is shouldn't tapestry be  
> using something other than a colon in the identifier?
>
> J
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
Jason Lea



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