Note that there are some explanatory texts on larger screens.

plurals
  1. POConditionally rendered button, design, calling an action
    primarykey
    data
    text
    <p>JFS1.2 + Richfaces 3.3</p> <p>Situation is as follows:</p> <p>JSP page renders conditionally one or another panelGroup.</p> <p>Within each panelGroup there are couple setters and one command button. Each of two panelGroups uses own bean for setting and performing action.</p> <p>On the top of a page there's selectOneRadio with (obvious) two items - coresponding tow options of conditional rendering.</p> <p>Page renders properly, switcher causes to render appropriate panel. Case is, commands buttons doesn't call an action.</p> <p>I know what's going on - when I click a button to call action dom is regenerated, but the value that hold my decision to display particular panel doesn't exist anymore. The button is not recreated, action is not fired.</p> <p>Technically:</p> <pre><code>&lt;h:selectOneRadio value="#{reportType}"&gt; &lt;f:selectItem itemLabel="x" itemValue="x"/&gt; &lt;f:selectItem itemLabel="y" itemValue="y"/&gt; &lt;a4j:support event="onclick" reRender="xPanel, yPanel/&gt; &lt;/h:selectOneRadio&gt; &lt;h:panelGrid id="xPanel "columns="2" rendered="#{reportType eq 'x'}"&gt; &lt;...some setters&gt; &lt;... commandbutton&gt; &lt;/h:panelGrid&gt; &lt;h:panelGrid id="yPanel "columns="2" rendered="#{reportType eq 'y'}"&gt; &lt;...some setters&gt; &lt;... commandbutton&gt; &lt;/h:panelGrid&gt; </code></pre> <p>Question is, how to design the page to obtain proper rendering and actions? For now, I created additional session bean that holds switching value (x|y), but that desing smells bad for me...</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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