Hi, I have the following code to create a selectOneMenu: <h:selectOneMenu id="country" tabindex="12" value="#{myForm.country}" disabled="true" > <f:selectItems value="#{enumeratiesBean.countries}"/> </h:selectOneMenu>
and it generates the following starttag: <select id="body:myForm:country" name="body:myForm:country" size="1" tabindex="12">
The problem is that the disabled attribute is not being rendered at all. Does anyone know this problem? Greets, Rob
Sorry....rendered="false" does work but i want to display the item as disabled instead of not showing it at all. Btw. readonly="true" doesn't work either. Grtz, Rob
Originally posted by Rob HK: Hi, I have the following code to create a selectOneMenu: <h:selectOneMenu id="country" tabindex="12" value="#{myForm.country}" disabled="true" > <f:selectItems value="#{enumeratiesBean.countries}"/> </h:selectOneMenu>
and it generates the following starttag: <select id="body:myForm:country" name="body:myForm:country" size="1" tabindex="12">
The problem is that the disabled attribute is not being rendered at all. Does anyone know this problem? Greets, Rob
Are you using JSF reference implementation and, if so, which version?
Can you tell me how did you do that. I am having a same problem that I want to render SelectOneMenu but want to display it as disabled.
Actually I need to do this on checkbox selection. If checbox is not selected then SElectOneMenu is disabled. How can we access "Disabled" attribute in managed bean?
Hi, Well, i think for this occasion you could write a small javascript function to enable/disable the selectOneMenu if you check/uncheck the checkbox. If you really want to disable the selectOneMenu through the backing bean i guess you could do something like this: