onchange « validation « JSF Q&A





1. onchange addresses the quantity box validation, why does Enter key gets passed?    stackoverflow.com

<h:inputText id="quantity"
value="#{_cartItem.quantity}" required="true" size="3"
maxlength="3">
<f:converter converterId="ValueConverter" />
<f:validateLongRange minimum="0" maximum="999" />
<a:support event="onchange"
    ajaxSingle="true"
    action="#{cSession.userCheckQuantity(_cartItem, index)}"
    reRender="minicartAjax, shoppingCartAjax, orderTotalAjax"></a:support>
When you click off the Quantity input ...

2. h:selectOneMenu onchange="submit()" immediate="true" does not skip validation of other inputs    stackoverflow.com

I can't set my h:selectOneMenu to submit immediately without validating other inputs. Here is the code:

<h:selectOneMenu value="#{a.avalue}" onchange="submit()" immediate="true">   
    <f:selectItems value="#{b.bvalue}" var="k" itemLabel="#{k.asdad}"  
 ...