Note that there are some explanatory texts on larger screens.

plurals
  1. POList elements not updated in c:forEach
    primarykey
    data
    text
    <p>I developing search engine for my database. I have a dialog and I get some inputs from this dialog. There are maximum 5 panels and the panels have selectOneMenus, inputTexts etc. I can show and hide input lines by pressing <code>+</code> and <code>-</code> buttons. This is not the problem.</p> <p>The problem is that none of properties of AdvancedSearch is set.</p> <p>Browse class has the objects below(setter,and getters are okey):</p> <pre><code>private List&lt;String&gt; advSearchCols = new ArrayList&lt;&gt;(); private List&lt;AdvancedSearch&gt; advSearch = new ArrayList&lt;&gt;(); </code></pre> <p>AdvancedSearch class :</p> <pre><code>private String selectedColumn = "", search = "", logic = "", isEqual = ""; private int widgetNum=-1; </code></pre> <p>Setter and getters are written properly and <code>advSearch</code> is initialized properly.</p> <pre><code> &lt;h:form &gt; &lt;p:dialog width="800px" height="300px" widgetVar="advSearchWg" closable="true" draggable="true" minimizable="true" dynamic="true" position="center" closeOnEscape="true" header="Advanced Search" onShow="L0.show()"&gt; &lt;c:forEach items="#{browse.advSearch}" var="adv"&gt; &lt;p:panel widgetVar="L#{adv.widgetNum}" visible="false" style="height: 50px;border:none;margin:0px 20px 0px 20px" closable="true"&gt; &lt;h:panelGrid columns="7"&gt; &lt;p:selectOneMenu value="#{adv.logic}" style="width: 100px;margin-left: 20px" &gt; &lt;f:selectItem itemLabel="AND" itemValue="AND" /&gt; &lt;f:selectItem itemLabel="OR" itemValue="OR" /&gt; &lt;/p:selectOneMenu&gt; &lt;p:selectOneMenu value="#{adv.isEqual}" style="width: 100px;margin-left: 20px" &gt; &lt;f:selectItem itemLabel="EQUAL" itemValue="equal" /&gt; &lt;f:selectItem itemLabel="NOT EQUAL" itemValue="not equal" /&gt; &lt;/p:selectOneMenu&gt; &lt;p:inputText value="#{adv.search}" required="true" autocomplete="true" style="width: 100px;margin-left: 20px"/&gt; &lt;h:outputText value="in" style="margin-left: 20px" /&gt; &lt;p:selectOneMenu value="#{adv.selectedColumn}" style="width: 100px;margin-left: 20px" &gt; &lt;f:selectItems value="#{browse.advSearchCols}" /&gt; &lt;/p:selectOneMenu&gt; &lt;c:if test="#{adv.nextWg() != (browse.advSearch.size() - 1)}"&gt; &lt;p:commandButton icon="ui-icon-plus" oncomplete="L#{adv.nextWg()}.show()" /&gt; &lt;/c:if&gt; &lt;c:if test="#{adv.widgetNum != 0}"&gt; &lt;p:commandButton icon="ui-icon-minus" oncomplete="L#{adv.widgetNum}.close()"/&gt; &lt;/c:if&gt; &lt;/h:panelGrid&gt; &lt;/p:panel&gt; &lt;/c:forEach&gt; &lt;p:commandButton process="@this" async="true" action="#{browse.advSearcher()}" value="Search" style="margin-left:60px" icon="ui-icon-search" /&gt; &lt;/p:dialog&gt; &lt;/h:form&gt; </code></pre> <p>OUTPUT :</p> <p><img src="https://i.stack.imgur.com/KgBGI.png" alt="enter image description here"></p> <p>Why are <code>logic</code>, <code>isEqual</code>, <code>search</code> and <code>selectedColumn</code> not updated? Why are elements of list not updated?</p> <p>I use Primefaces 3.5RC1.</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.
 

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