Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF selectOneListBox listener doesn't get fired
    primarykey
    data
    text
    <p>I've searched everywhere but couldn't find an answer for my problem, All most all questions and answers are relates to selectOneMenu. Iam using selectOneListbox component in my page as shows below</p> <pre><code>&lt;h:selectOneListbox id="basic" value="#{location.selectedCategory}" style="width: 400px; border: none;" &gt; &lt;f:selectItems value="#{location.categories}" var="y" itemLabel="#{y.title} (#{y.itemCount})" itemValue="#{y}" /&gt; &lt;f:ajax listener="#{location.onNodeSelect}"/&gt; &lt;f:ajax render="itemsPanel" execute="@this"/&gt; &lt;/h:selectOneListbox&gt; </code></pre> <p>My bean,</p> <pre><code> @ManagedBean(name = "location") @SessionScoped public class LocationServiceBean extends BaseService implements Serializable{ public void onNodeSelect(AjaxBehaviorEvent event) { log.info("Entering method : onNodeSelect : "); if(null != selectedCategory){ GetCategoriesAndItemsResponse response =getLocationSupport().getItemsByCategoryAndLocation(selectedCategory.getId(), selectedLocationId); if(response.getStatusCode().equals("0")) { items = response.getData().getItems(); log.info("Items size: " + items.size()); } } } } </code></pre> <p>Problem here is, above listener in the selectOneListBox doesn't get fired when i select items in the list box. Tried with primeface (3.5) component as well, but no luck. </p> <p>UPDATE: added more code</p> <pre><code>&lt;h:form id="venuForm" prependId="false"&gt; &lt;legend&gt;2. Choose Venue&lt;/legend&gt; &lt;div class="control-group"&gt; &lt;label class="span3" for="Country"&gt;Venue&lt;/label&gt; &lt;div class="controls"&gt; &lt;h:selectOneMenu value="#{location.selectedLocationId}" id="select01" required="true" requiredMessage="Location is a mandatory field" styleClass="span8"&gt; &lt;f:selectItem itemValue="#{null}" itemLabel="Select Location" noSelectionOption="true" /&gt; &lt;f:selectItems value="#{location.allLocations}" var="c" itemLabel="#{c.title}" itemValue="#{c.locationId}" /&gt; &lt;f:ajax listener="#{location.loadCategoriesListner}" render=":itemForm:categoriesPanel" execute="@this" /&gt; &lt;f:ajax execute="@this" render=":itemForm:itemsPanel" /&gt; &lt;/h:selectOneMenu&gt; &lt;/div&gt; &lt;/div&gt; &lt;/h:form&gt; &lt;h:form id="itemForm" prependId="false"&gt; &lt;legend&gt;3. Choose Gift&lt;/legend&gt; &lt;div class="control-group"&gt; &lt;p:outputPanel id="panel" autoUpdate="true"&gt; &lt;div style="padding-left: 5px; padding-right: 5px; padding-bottom: 5px; border: none;"&gt; &lt;p:panel id="categoriesPanel" rendered="#{location.categories != null}" autoUpdate="true" style=" border: none;"&gt; &lt;h:selectOneListbox id="basic" value="#{location.selectedCategory}" style="width: 400px; border: none;"&gt; &lt;f:selectItems value="#{location.categories}" var="y" itemLabel="#{y.title} (#{y.itemCount})" itemValue="#{y}" /&gt; &lt;f:ajax listener="#{location.onNodeSelect}" render="itemsPanel" execute="@form" event="change"/&gt; &lt;/h:selectOneListbox&gt; &lt;/p:panel&gt; &lt;/div&gt; &lt;/p:outputPanel&gt; &lt;div class="clear" style="height: 30px;"&gt;&lt;/div&gt; &lt;div style="padding-bottom: 5px; padding-top: 5px;"&gt; &lt;p:panel id="itemsPanel" style="float: left;" header="Items"&gt; &lt;ui:repeat value="#{location.items}" var="o" id="itemTable"&gt; &lt;div style="width: 170px; height: 200px; margin: auto; float: left; border-style: solid; border-color: #ECE5B6; border-width: thin;"&gt; &lt;div style="margin: 5px; padding: 5px;"&gt; &lt;div style="margin-bottom: 5px;"&gt; &lt;h:outputText value="#{fnc:getTitleTruncateText(o.title)}" style="margin: 0 auto; padding: 0 0 20px; color: #9A1326; width: 100px; font-size: 14px; text-align: center;" /&gt; &lt;BR /&gt; &lt;/div&gt; &lt;div style="padding-left: 45px; margin-bottom: 5px;"&gt; &lt;h:graphicImage value="http://dev.cdn.abc.com/#{o.imageId}_3.png" id="itemImage" alt="#{o.title}" /&gt; &lt;/div&gt; &lt;div style="padding: 5px 10px; background-color: #FFC200; margin: 15px auto 0 auto; width: 100px; text-align: center; color: #29000F; border: 1px solid #F2BD00;"&gt; &lt;h:outputText value="$ #{fnc:formatDoubleValue(o.salePrice)}" /&gt; &lt;/div&gt; &lt;div class="clear" style="height: 5px;"&gt;&lt;/div&gt; &lt;div style="float: left;"&gt; &lt;div style="float: left; margin-right: 50px;"&gt; &lt;p:spinner id="itemQty" value="#{o.selectedQty}" size="3" min="1" max="#{o.qtyAvailable}" style="width: 20px;" /&gt; &lt;/div&gt; &lt;div style="float: right;"&gt; &lt;h:commandButton value="Add" id="addToCartBtn" rendered="#{o.qtyAvailable &gt; 0 }" actionListener="#{location.addItemToCart(o)}" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/ui:repeat&gt; &lt;/p:panel&gt; &lt;/div&gt; &lt;div class="clear" style="height: 30px;"&gt;&lt;/div&gt; &lt;div style="float: right;"&gt; &lt;h:commandButton action="#{location.gotoUserDetails}" value="Next" onclick="return(validate());" rendered="#{!empty location.selectedItems}" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/h:form&gt; </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