You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by bansi <ma...@yahoo.com> on 2007/02/14 00:10:31 UTC

Dynamically change default value in h:selectOneMenu

Here is the situation

The h:selectOneMenu has default value set to "New" as shown below

[code]
 <h:outputText value="Manufacturer" />
	 		 		 	  		  
	 		 <h:selectOneMenu id="manufList"
value="#{manufacturerBean.selectedManufacturer}"  >               
              
              <f:selectItem itemLabel="New" itemValue="New" />   
              <f:selectItems value="#{manufacturerBean.manufacturerList}" />   
              <a4j:support
action="#{manufacturerBean.loadManufacturerDetails}" event="onchange"
reRender="t3,t4,t5,t6,t7,t8,t9,t10" />           
           </h:selectOneMenu>    
[/code]

User picks "New" value from the dropdown to create a new record. 
Now what i wana happen is the moment new record is created in the Database i
wanna dynamically pull that new record into dropdown instead of still
showing New value in the drop down

Please note this should happen in singleshot without asking the user to pick
a newly created value from the dropdown i.e. dynamically switch from "New"
value in dropdown to "Newly created value in Database"

Any pointers/suggestions will be greatly appreciated

Regards
Bansi 

-- 
View this message in context: http://www.nabble.com/Dynamically-change-default-value-in-h%3AselectOneMenu-tf3224208.html#a8955567
Sent from the MyFaces - Users mailing list archive at Nabble.com.