views:

1185

answers:

0

Hi, I want to to achieve the following: A page should contain two inputfields and a result field that contains a server calculated result. Each of the input fields shall immidiently be validate using a4j. The result field shall on any change be updated. Here is what I've got so far:

..
<h:inputText id="first"   value="#{bean.first}">
    <f:validateDoubleRange minimum="0" maximum="10"/>
    <a4j:support event="onkeyup" requestDelay="400"
         eventsQueue="myQueue" ignoreDupResponses="true" reRender="first_message"/>
</h:inputText>

<a4j:outputPanel id="deceleration_message">
    <h:message for="decelerationuser" errorClass="error"/>
</a4j:outputPanel>

< The same forthe "second" value>

<a4j:outputPanel ajaxRendered="true">
    <h:outputLabel value="#{bean.result}" />    
<a4j:outputPanel/>

The backing beans result property will return first+second. My Problem: If the user first enteres valid values and than enteres wrong values, the "old" calculation result will still be displayed. The backing bean never gets the information the input values have become invalid. I need a way to reset the result field if any validation fails but would like to still use the buildin validation.