f:ajax resetValues="true" does not seem to work

1k views Asked by At

I want to reset values when I submit a form.

 <h:form id="form">
    <div class="success_wrapper">
        <div class="success-message">Contact form submitted</div>
    </div>
    <div class="string">
        <label class="name">                                        
            <h:inputText id="name" value="#{mailhandler.name}" pt:placeholder="Name*:"/>                                    
        </label>
        <label class="email">                                         
            <h:inputText id="email" value="#{mailhandler.senderEmail}" pt:placeholder="E-mail*:"/>
        </label>
        <label class="phone">                                         
            <h:inputText id="telephone" value="#{mailhandler.telephone}" pt:placeholder="Telephone*:"/>
        </label>
    </div>
    <label class="message">                                    
        <h:inputTextarea value="#{mailhandler.comment}" pt:placeholder="Comment*:"/>
    </label>
    <div class="clear"></div>
    <div class="btns">                                    
        <h:commandLink id="submitlink" class="link" value="submit" action="#{mailhandler.sendEmail}" >                                        
            <f:ajax render="@form" execute="@form" onevent="handleDisableButton" resetValues="true"/>
        </h:commandLink>     
    </div>
    <br/>                               
    <h:outputText id="output" value="#{mailhandler.result}" />
</h:form>

I tested this code example but for some reason the old values are still kept after the AJAX call.

I added resetValues="true" but the result is the same. Can you help me to find the issue?

0

There are 0 answers