jsf - Why does h:selectOneRadio does not have a "name" attribute? -


I want to create some crazy groups with selectOneRadio, so I decide to create my own custom components, & lt; Input & gt; Tag code> name attribute (as you know, same name means radio buttons are in the same group). The renderer is correct, so I have & lt; Input & gt; which is used to render in such a way

  & lt; Input name = "myForm: test1" id = "myForm: test1: 0" value = "0" type = "radio" & gt;   

Presenting this way now

  & lt; Input name = "foo" id = "myForm: test1: 0" value = "0" type = "radio" & gt;   

However, when I submit a form, EL stops (h: commandButton and p: commandButton). So if I have this

  & lt; Xxx: selectOneRadio id = "test1" value = "# {myBean.selectedFood}" & gt;   

Then print EL value, selectedFood , but if I

    

Which is name = foo to & lt; Input & gt; will be created in the tag. So stop EL binding work selected feed is zero .

More interesting, if I put it in

    

Which is the myForm: test1 correct client id, then the EL binding work is again, so it does not seem that this is my code that will stop compulsive work. Used to be . Does JSF need the name attribute on the client ID on the input tag?

name becomes the HTTP request parameter name and its The usage is to collect the submitted HTTP request parameter values. This is the default for the JSF Component Client ID and the archive decode () method renderer (or UIComponent itself). How to alter the request parameter values ​​along with override / implementing the decode () of renderer .

Comments