• Post Reply Bookmark Topic Watch Topic
  • New Topic

The styleclass on h:selectOneMenu component is not working

 
Pushpalatha Gowdra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a code like this:
<h:selectOneMenu id="designation" value="#{user.designation}" styleClass="selectbox">
<f:selectItems value="#{dropdown.designations}" />
</h:selectOneMenu>

which renders to HTML:
<span class="selectbox"><select id="_id0:designation" name="_id0:designation" size="1"><option value="100">SE</option>
<option value="200">SSE</option>
<option value="300">TL</option>
<option value="400">PL</option>
<option value="500">PM</option>
</select></span>

Since style class is within <span> but not inside <select>; the associated stylecalss is not getting reflected.

Please let me know whether its a defect with <h:selectOneMenu> component? also let me know how can I achieve the styleclass setting to <h:selectOneMenu> component

Thanks in advance!

Regards,
Pushpa
 
Anil Sadineni
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which JSF RI are you using? I don't see this problem in MyFaces.

Anil.
 
Pushpalatha Gowdra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anil,

I am using JSF1.0, looks like JSF1.1 has fixed this defect. I am yet to try JSF1.1, and I can't go for the latest version JSF1.2 as I have the limitation to use JDK1.4

I am new to JSF, so don't know which JSF RI to use. Can you please suggest me what all JSF RI projects are available and which one would be better?

Thanks & Regards,
Pushpa
 
Pushpalatha Gowdra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Resolved - for time being]

Hi,

There is a round around solution to the problem. set a default style for select in the included .css and apply the required style on <h:selectOneMenu> component. So far its working fine

Regards,
Pushpa
 
Anil Sadineni
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pushpa,

As far as i know, JSF RI from SUN and MyFaces from Apache are avilable.

Yes, to resolve the problem, you can have styleshet for the html id.

Thanks,
Anil.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!