tags:

views:

116

answers:

2

Hi,

I need to create a scenario where on a page load the rich:comboBox defaults to a certain string value, sort of the way it would if I were using a selectOneMenu. Or if that is impossible I would need to find a way to edit a selectOneMenu so that it looks like the rich:comboBox, including the skin (deepMarine) we are using. I thought this would be a simple task and yet I can't find any instructions on it. Below is the code I'm currently dealing with:

<rich:comboBox id="status"  required="true" defaultLabel="status" 
    value="#{contractorMBean.userStatusDisplay}" 
    enableManualInput="false" width="155px">
       <f:selectItems value="#{contractorMBean.statusList}"  />
</rich:comboBox>

Any help is greatly appreciated as this issue has been driving me up a wall.

Thanks in advance.

+1  A: 

The easiest way to solve this would be to assign a value to the userStatusDisplay in the bean. I was also having some trouble with rich:combobox and to be perfectly honest I'm quite disappointed with it.

Zenzen
A: 

<rich:comboBox> is a suggestion box - i.e. it does accept values different from the ones listed. It doesn't have a "currently selected item", it has only a "current value". For that reason:

  • you can assign the value using javascript, on document.onload
  • you can specify the value of the property in the managed bean
Bozho