Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to dynamically refresh h:selectManyCheckbox selectItems
    primarykey
    data
    text
    <p>I am trying to implement a scenario using JSF. I have a <code>commandExButton</code> and when user click this button "A" it shows the <code>panelDialog</code> which contains the <code>selectManyCheckBox</code> items. I generat these items in the backend bean by parsing one file which is continuously getting updated. What I want is, whenever I click this button "A" I should get the latest selectItems by parsing the file through the backend bean. But what I get it the same selectItem which was generated when page rendered first time. So as of now I have a workaround, in which I included one refresh button which actually refresh the page and then user click "A" to get the latest selectItem by parsing the current file's content. But is it doable in anyway without adding new button and using the existing button?</p> <p>Following is the code which I am using </p> <pre><code>&lt;td&gt; &lt;hx:commandExButton id="preferenceButton" styleClass="form" value="#{nls.preferenceLink}" title="#{nls.preferenceLinkTitle}" type="submit" /&gt; &lt;/td&gt; &lt;td&gt; &lt;h:form id="PrefForm" rendered="#{Test.isCurrent}"&gt; &lt;hx:panelDialog type="modal" id="preferenceSet" styleClass="panelDialog" for="preferenceButton" title="#{nls.preferenceDialogTitle}"&gt; &lt;h:outputText styleClass="panelStartMessage" style="display:block;" value="#{nls.preferenceDialogWindowText}" /&gt; &lt;h:panelGroup rendered="#{Test.hasSelectItem }" style="display:block;width:300px;height:360px;overflow:auto;" styleClass="panelGroup" id="prefPanelGroup"&gt; &lt;h:selectManyCheckbox value="#{Test.selectedItems}" layout="pageDirection"&gt; &lt;f:selectItems value="#{Test.selectItems}" /&gt; &lt;/h:selectManyCheckbox&gt; &lt;/h:panelGroup&gt; &lt;hx:panelBox styleClass="information_box" id="noCommandWindow" layout="lineDirection" rendered="#{!Test.hasSelectItem }"&gt; &lt;h:outputText styleClass="outputText" id="cmdInfo" value="#{nls.noCommands}" /&gt; &lt;/hx:panelBox&gt; &lt;hx:panelBox id="buttonBox1" styleClass="panelStartBox" layout="lineDirection"&gt; &lt;hx:commandExButton id="submitPref" styleClass="commandExButton" type="submit" value="#{nls.submit}" action="#{Test.action}"&gt; &lt;hx:behavior event="onclick" behaviorAction="hide" targetAction="preferenceSet" id="behaviorSubmitPref" /&gt; &lt;/hx:commandExButton&gt; &lt;hx:commandExButton id="CancelPref" styleClass="commandExButton" type="submit" value="#{nls.cancel}" action="Test"&gt; &lt;hx:behavior event="onclick" behaviorAction="hide" targetAction="preferenceSet" id="behaviorCancelPref" /&gt; &lt;/hx:commandExButton&gt; &lt;/hx:panelBox&gt; &lt;/hx:panelDialog&gt; &lt;/h:form&gt; &lt;/td&gt; </code></pre> <p>Code in Bean:</p> <pre><code>public class Test{ private List&lt;String&gt; selectedItems; private List&lt;SelectItem&gt; selectItems; public List&lt;SelectItem&gt; getSelectItems() { // populate the selectItem here... } } </code></pre>
    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