How to set default value of h:selectOneRadio button

前端 未结 4 2193
梦毁少年i
梦毁少年i 2021-02-19 21:28

I am unable to set the default value of h:selectOneRadio as i need radio button to be pre selected



        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-19 21:52

    I did a little test, it works just fine as expected, but I also observed that when you leave out the tag, the behaviour of radio buttons is unpredictable and dependent on the webbrowser. The JSF-generated HTML output looks correct, but the webbrowser would in the view only select the button which was actually selected by the user in the previous request on the same page. If the cache is empty, none of the buttons is selected. At least, that was the case in FF.

    So, it look like that you're forgotten to put a around it.

提交回复
热议问题