0

Hi I am wondering the best way to implement this requirement. I have a database table with a varchar2 field to populate the selectOneMenu. On the same table is a column of type CHAR(1) having a 'Y' or 'N' value, and I want to use this to also disable/enable the field.

I was going for something simple like the first option demo in BalusC answer here How to populate options of h:selectOneMenu from database? and Here was a post I looked at having to do with disabling items in selectOneMenu - <h:selectOneMenu> with temporary disabled SelectItems

But I do not quite know how can I combine the two things above here in an EASY way to manage both enable/disabled and populating the list?

Community
  • 1
  • 1
Kairan
  • 5,342
  • 27
  • 65
  • 104
  • 1
    Is this acceptable as dupe? http://stackoverflow.com/questions/6932034/how-to-conditionally-render-an-fselectitem-tag Basically just use `itemDisabled` attribute along with a bit of CSS to hide the item from UI. – BalusC Oct 28 '15 at 20:59

1 Answers1

0

I just figured out that the best way is to create a custom object to back the values here. For example: http://arjan-tijms.omnifaces.org/2011/12/automatic-to-object-conversion-in-jsf.html

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Kairan
  • 5,342
  • 27
  • 65
  • 104