开发者

can i make my dropdown box defaulted to empty and if i click on dropdown it should the values

hi my dropdown has some 3 values

1)Apple 2)mango 3)grape

开发者_Go百科when my page loads my dropdown is defaulted to Apple(first value)

how can i make dropdown defaulted to empty and when i clicked on dropdown it should show the values

in java jsf (i am getting dropdown values as List)


I would just add an empty option, and validate as needs be.


I generally add an empty field with a null ID and a value that says something like "Select Fruit". I believe you can have both selectItem and selectItems. So something like this should work inside your JSF selectOneMenu component:

<f:selectItem itemValue="" itemLabel="Select Fruit" />
<f:selectItems value="#{fruitList}" /> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜