cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ezkovich Glen <gezkov...@austin.rr.com>
Subject Re: [VOTE] Naming rule for HTML IDs generated by CForms
Date Mon, 07 Nov 2005 01:05:11 GMT

On Nov 6, 2005, at 4:13 PM, Sylvain Wallez wrote:

> Jean-Baptiste Quenot wrote:
>> * Sylvain Wallez:
>>
>>
>>> The  main  point  being  that   this  rule  *must*  ensure  that
>>> generated IDs  can never conflict  with widget full  names (e.g.
>>> "foo.bar-input"  would potentially  conflict with  a "bar-input"
>>> widget sibling of "bar").
>>>
>>
>> Then why don't  you use a « reserved » keyword  inbetween, such as
>> « bar-___reserved_cforms_input___ »?
>>
>
> Because I'm concerned by the length of these generated IDs that  
> will clutter up the page.

I understand this concern but in general I think distinguishing  
between auto generated names (ids) and author generated names is a  
good idea. A convention for auto generated names is to begin them  
with "_". In this case it can conflick with auto-generated widget  
names. A simple convention for naming in this case could be simply to  
use something along the lines of foo.bar._cfInput or, since this  
likely will step on some widget names, foo.bar._agInput (ag for auto- 
generated).  A concern here is that root of the ID is somewhat  
obscured. An alternative naming would be along the lines of  
foo.bar.cf_input. While not following the more general convention it  
comes close. (I'm sure someone will confuse it for a column name ;-).)

While there remains clutter it is significantly reduced to 3  
characters per id. A minimal amount considering the clarity it brings.



Glen Ezkovich
HardBop Consulting
glen at hard-bop.com



A Proverb for Paranoids:
"If they can get you asking the wrong questions, they don't have to  
worry about answers."
- Thomas Pynchon Gravity's Rainbow


Mime
View raw message