Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After taking into account <strong>Bento</strong>'s advices, i realitzed the only way to make it work as I wanted was using AJAX <code>a4j</code>.</p> <p>The changes I've had to introduce in my code are:</p> <ol> <li>Replace <code>h:commandButton</code> "select all" buttons with <code>a4j:commandButton</code>.</li> <li>Define <code>id</code> tags for my <code>h:selectOneMenu</code> components, so I could <em>reRender</em> the components through <code>a4j:commandButton</code> defined before.</li> </ol> <p>The <strong>JSF</strong> original page has been modified as follows:</p> <pre><code>(...) &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;a4j:commandButton value="Select all opt1" action="#{MyClass.selectOpt1}" reRender="list1,list2,(...)" ajaxSingle="true" /&gt; &lt;a4j:commandButton value="Select all opt2" action="#{MyClass.selectOpt2}" reRender="list1,list2,(...)" ajaxSingle="true" /&gt; &lt;a4j:commandButton value="Select all opt3" action="#{MyClass.selectOpt3}" reRender="list1,list2,(...)" ajaxSingle="true" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;h:outputText value="List 1:" /&gt; &lt;/td&gt; &lt;td&gt; &lt;h:selectOneMenu value="#{MyClass.list1Val}" id="list1"&gt; &lt;f:selectItems value="#{MyClass.listOfOptions}" /&gt; &lt;/h:selectOneMenu&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;h:outputText value="List 2:" /&gt; &lt;/td&gt; &lt;td&gt; &lt;h:selectOneMenu value="#{MyClass.list2Val}" id="list2"&gt; &lt;f:selectItems value="#{MyClass.listOfOptions}" /&gt; &lt;/h:selectOneMenu&gt; &lt;/td&gt; &lt;/tr&gt; (...) </code></pre> <p>Thanks a lot <strong>Bento</strong> for your advices!</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.
    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