You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kevin <kg...@protech.newsouth.net> on 2006/06/19 19:22:36 UTC

SubView and CSS ID selectors

Hello,


Using a <f:subview/> within my layout like below:

<t:div id="ID_one">
                             <f:subview id="ID_two">
                               <t:div id="someId">
					some content...
  </t:div>
                             </f:subview>

                         </t:div>


results in  an HTML id of "ID_one:ID_two".

I seem unable to style this with CSS using something like:

#ID_one:ID_two{}

or

#ID_two{}


I can style it with a class but I actually need to style it and access 
with JavaScript. Does anyone have any suggestions?

Thanks in advance,

Kevin


Re: SubView and CSS ID selectors

Posted by Gilles DEMARTY <gi...@gmail.com>.
Hi kevin,

forceId="true" is your friend
on all t: components

[1] http://myfaces.apache.org/tomahawk/forceId.html



2006/6/19, Kevin <kg...@protech.newsouth.net>:
> Hello,
>
>
> Using a <f:subview/> within my layout like below:
>
> <t:div id="ID_one">
>                              <f:subview id="ID_two">
>                                <t:div id="someId">
>                                         some content...
>   </t:div>
>                              </f:subview>
>
>                          </t:div>
>
>
> results in  an HTML id of "ID_one:ID_two".
>
> I seem unable to style this with CSS using something like:
>
> #ID_one:ID_two{}
>
> or
>
> #ID_two{}
>
>
> I can style it with a class but I actually need to style it and access
> with JavaScript. Does anyone have any suggestions?
>
> Thanks in advance,
>
> Kevin
>
>

Re: SubView and CSS ID selectors

Posted by Kevin <kg...@protech.newsouth.net>.
Thank you both so much!


Re: SubView and CSS ID selectors

Posted by Andrew Robinson <an...@gmail.com>.
Use force ID:

<f:subview id="subview">
<t:div id="myid" forceId="true" />
<script>
// <![CDATA[
var element = document.getElementById("myid")
// ]]>
</script>
</f:subview>

-Andrew

On 6/19/06, Kevin <kg...@protech.newsouth.net> wrote:
> Hello,
>
>
> Using a <f:subview/> within my layout like below:
>
> <t:div id="ID_one">
>                              <f:subview id="ID_two">
>                                <t:div id="someId">
>                                         some content...
>   </t:div>
>                              </f:subview>
>
>                          </t:div>
>
>
> results in  an HTML id of "ID_one:ID_two".
>
> I seem unable to style this with CSS using something like:
>
> #ID_one:ID_two{}
>
> or
>
> #ID_two{}
>
>
> I can style it with a class but I actually need to style it and access
> with JavaScript. Does anyone have any suggestions?
>
> Thanks in advance,
>
> Kevin
>
>