You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by John Singleton <jo...@yahoo.com> on 2006/07/24 17:41:03 UTC

SelectOneMenu initial value problem

I'm using a h:selectOneMenu componenent and setting it's initial value using the 'value' attribute i.e.

<h:selectOneMenu value="#{backing.configNetworkEntity}">

This is working when on the initial page visit, but subsequent visits don't work. I know the backing.configNetworkEntity object is set because I can display it's value in the page using EL.

Diging into the code I see that in HtmlRendererUtils.renderSelectOptions the selected attribute is written when the the String version of SelectItem.value is included in 'lookupSet'.

'lookupSet' is build from the submittedValue or if its null the 'value' of the object. However, submittedValue is never null as HtmlRendererUtils.decodeUISelectOne sets submitted value to RendererUtils.NOTHING if the request doesn't contain a parameter for the selectOne menu. 
Have I discovered a bug, or do I need to do something different to set the inital value of the combo box?

Thanks

John