Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does h:selectOneRadio does not have a "name" attribute?
    primarykey
    data
    text
    <p>I want to do some crazy grouping with SelectOneRadio, so I decide to create my own custom component that allow me to specify the <code>name</code> attribute of the <code>&lt;input&gt;</code> tag (as you know, same <code>name</code> means the radio buttons are in the same group). The renderer is correct, so I have a <code>&lt;input&gt;</code> that used to render like this</p> <pre><code>&lt;input name="myForm:test1" id="myForm:test1:0" value="0" type="radio"&gt; </code></pre> <p>now render like this </p> <pre><code>&lt;input name="foo" id="myForm:test1:0" value="0" type="radio"&gt; </code></pre> <p>However, EL stop working when I submit a form (same for h:commandButton and p:commandButton). So if I have this</p> <pre><code>&lt;xxx:selectOneRadio id="test1" value="#{myBean.selectedFood}"&gt; </code></pre> <p>then EL work, <code>selectedFood</code> print out the corrected value, but if I put in</p> <pre><code>&lt;xxx:selectOneRadio id="test1" value="#{myBean.selectedFood}" groupId="foo"&gt; </code></pre> <p>which will make the <code>name=foo</code> in the <code>&lt;input&gt;</code> tag. Then EL binding stop working. <code>selectedFood</code> is <code>null</code>. </p> <p>More interestingly, If I put in this</p> <pre><code>&lt;xxx:selectOneRadio id="test1" value="#{myBean.selectedFood}" groupId="myForm:test1"&gt; </code></pre> <p>which <code>myForm:test1</code> is the correct client Id, then EL binding work again, so it does not look like it is my code that make the binding stop working. <strong>Does JSF require the <code>name</code> attribute of the <code>input</code> tag to the client id?</strong> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload