2 Replies Latest reply on May 12, 2008 8:59 AM by lucab

    rich:comboBox does not keep defaultValue after form submit

    lucab

      I want rich:comboBox to start with a default value (not a defaultLabel). And this is easily achieved doing something like:

      jsp code:
      <rich:comboBox value="#{bean.aProperty}">...

      java code:
      class Bean { SomeType aProperty = someDefaultValue; }

      when the page is first rendered it's all ok because i see the string displayed by the combox to what in my selectItems array corespond to the 'someDefaultValue' we saw some lines before.
      It looks like that if now i push the submit button the 'someDefaultValue' will be POSTed to the server, but what really happens is that i get my 'aProperty' set to its 'SomeType' default value. Ok, yes, you discovered me, i'm using comboBox as a select and definitely this is not its purpose...anyway there's something i can do to POST default values with combobox?