2

EDIT: I adjusted the code, but the problem remains. See below

I have this p:selectOneRadio:

<p:selectOneRadio 
    value="#{bean.val}"
    id="val"
    layout="custom"
>
    <f:selectItem itemLabel="" itemValue="A" />
    <f:selectItem itemLabel="" itemValue="B" />
    <p:ajax update="wrapper AData" />
</p:selectOneRadio>

and this p:radioButton:

<h:panelGroup id="wrapper">
    <p:radioButton for="val" itemIndex="0" rendered="#{bean.val != 'A'}"/>
</h:panelGroup>

and AData contains other inputs. They are displayed only if the first radio is selected. But this is not important.

When I get a fresh page, both the radios are displayed. When I select one of them, the first one disappear.

The expected behavior by me is that the first radio disappear when selected, and re-appear when the other one is selected.

EDIT2: I tried to remove the rendered. It continued to not work! After I removed the update, it remains visible. But render does not work, so the radio never disappear.

What I'm wronging?

Marco Sulla
  • 15,299
  • 14
  • 65
  • 100

1 Answers1

2

I found the solution. The problem was I have to update an ancestor in common with both the p:selectOneRadio and the p:radioButton

Marco Sulla
  • 15,299
  • 14
  • 65
  • 100