Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax Listener called only on alternate selections of <p:selectOneMenu>
    text
    copied!<p>I am building a dropdown by reading the database and then selecting the value for further processing. The problem occurs in the processing part.</p> <p>The ajax listener for the dropdown gets triggered only on <em>alternate</em> selection and not on <em>every</em> selection. If I select a value for the first time, the listener does not trigger. If I select the second time it gets triggered again. The third time, again it doesn't trigger and so on.</p> <pre><code>&lt;p:selectOneMenu id="selectedBPZero" value="#{selectCriteriaBean.selectedBPZero}" &gt; &lt;f:selectItem itemValue="0" itemLabel="Select Option" /&gt; &lt;f:selectItem itemValue="1" itemLabel="Add New BP" /&gt; &lt;f:selectItems value="#{selectCriteriaBean.bpZeroList}"/&gt; &lt;p:ajax listener="#{selectCriteriaBean.bpZeroListSelectActionByAjaxCall}" event="change" update="selectedBPOne,selectedBPOneTextInfo" process="@this"/&gt; &lt;/p:selectOneMenu&gt; </code></pre> <p>Listener Method is as below</p> <pre><code>public void bpZeroListSelectActionByAjaxCall() { setParentBusinessProcessId(0); setSelectedBPOne(0); setSelectedBPTwo(0); setBPOneListRendered(false); setBPTwoListRendered(false); setModifyButtonBPZeroRendered(false); setModifyButtonBPOneRendered(false); setModifyButtonBPTwoRendered(false); if (getSelectedBPZero() == 0) { RedirectScreen.redirectToPage("/ALM/home.faces"); } else { if (getSelectedBPZero() == 1) { setAddBPLevelNumber(0); addBP(); } else { setBPOneListRendered(true); setModifyButtonBPZeroRendered(true); // Get BP List bpLevelOneList = bpList(1,getSelectedBusinessProcessLevelZero()); RedirectScreen.redirectToPage("/ALM/home.faces"); } } } </code></pre> <p>I have tried changing the event to <code>valueChange</code> and <code>click</code>, but it doesn't work. I am working on Eclipse with GlassFish setup.</p> <p>The same code I tested in Rational Application Developer (RAD) and it is working there.</p> <p>TIA</p>
 

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