myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Marinschek" <martin.marinsc...@gmail.com>
Subject Re: Changing the NAMING_SEPARATOR to avoid CSS problems.
Date Tue, 07 Aug 2007 18:53:32 GMT
@Simon: as Adam has already mentioned - this won't work in IE6
(haven't checked in IE7, but I guess it is the same).

regards,

Martin

On 8/7/07, Simon Lessard <simon.lessard.3@gmail.com> wrote:
> Ohhhhh, didn't know that trick. Not sure if I'll ever use it, but it's sure
> nice to know.
>
>
> On 8/7/07, Michał 'Gandalf' Stawicki < stawicki@gmail.com> wrote:
> > use can escape : in CSS:
> >
> > #overview\:element
> >
> > On 07/08/07, Simon Lessard <simon.lessard.3@gmail.com> wrote:
> > > The main one is probably the risk to cause a name clash with user
> defined
> > > ids.
> > >
> > >
> > > On 8/7/07, Bryan Basham <bbasham@stillsecure.com > wrote:
> > > > Hello,
> > > >
> > > > There is a well-known problem with JSF's choice of using a colon
> > > > as the NAMING_SEPARATOR character: The CSS standard does
> > > > not work well with HTML IDs that include a colon in the name.
> > > > So for example, if you try to style a specific input element...
> > > > <h:form id='x'>
> > > >   <h:inputText id='name' ... />
> > > > </h:form>
> > > >
> > > > ...with a CSS file entry...
> > > > input#x:name { /* style configuration */}
> > > >
> > > > This is illegal in CSS.  As I said, this is well known.  Here are a
> few
> > > > links that a co-worker discovered in his investigation:
> > > >
> > > >
> > >
> https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=161
> > > >
> > >
> http://www.nabble.com/Colons-in-component-ids-tf1476983.html#a4015739
> > > > http://wiki.apache.org/myfaces/css_component_ids
> > > >
> > > > My team is investigating a work-around for this.  I read through
> > > > the UIComponentBase.getClientId() code and it is clear that we
> > > > cannot alter the NAMING_SEPARATOR character.  However,
> > > > I did notice the component's renderer is given the opportunity to
> > > > convert the name before it is stored (and returned from the
> getClientId
> > > > method).  The base Renderer.convertClientId method simply returns
> > > > the passed in string; no conversion.
> > > >
> > > > Has anyone tried to override this convertClientId method to change the
> > > > colon to some other, CSS-compatible character?  If so, which character
> > > > did you use to replace the colon?  And did this conversion cause other
> > > > problems within the JSF framework itself?
> > > >
> > > > The PROs are clear: enables component-specific styling.  The CONs are
> > > > not so obvious, but the biggest "gotcha" I have found is that if you
> use
> > > > standard JSF components, you must override their renderers to support
> > > > the conversion.  Can anyone think of other gotchas?
> > > >
> > > > Regards,
> > > > Bryan
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Michał Stawicki
> >
> > stawicki@gmail.com
> > http://stawicki.jasliska.pl
> >
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces
Mime
View raw message