Using <f:selectitems> in html to make dependent drop down list using javascript -
i able select value 1 drop down , depending on value, able disable drop down list. want when 2nd drop down disabled should show '(select one)'.
this code:
<h:selectonemenu id="tier" isrequired="true" value="#{allocationtemplatedetailsbackingbean.allocationrule.allocationfulfillparameters.fulfillmenttierstr}"> <f:selectitems id="tierlist" value="#{allocationtemplatedetailsbackingbean.fulfillmenttierlist}" /> .... ... </h:selectonemenu> , javascript function follows: function controlfulfillmenttierdropdownlist() { var strategy = document.getelementbyid('dataform:strategy'); if(strategy != null) { if(strategy.value == 5) { var fulfillmenttierdropdownlist = document.getelementbyid('dataform:tier'); fulfillmenttierdropdownlist.disabled = true; var supplytypepanel = document.getelementbyid('supplytypediv'); supplytypepanel.style.display = "none"; } } }
from tierlist, first value in list '(select one)', whenever strategy.value==5, want disable tierlist dropdown (which have done disable attribute of tier), want set value visible '(select one)' instead of older value present.
Comments
Post a Comment