Pregunta

Here is my registration.xhtml page I have made using Java Server Faces. What I'm trying to do is reset the panel of entries. To do this, i have simply labelled a button reset and put the page address in the action field so that the page re-loads so that the field is cleared. I was wondering if there was a more correct way of doing this... Thanks. (No insults about my lack of knowledge please, I am a complete novice)

            <h:form>
            <h:commandButton value="Register" action="someotherpage.xhtml"/> 
            <h:commandButton value="RESET"  action="registration.xhtml"/>
            </h:form>
        </h:panelGrid>          
    </h:body>    
</html>
¿Fue útil?

Solución

In case you don't need to execute any kind of special code in the back, you can clear the form using the following button:

<h:commandButton type="reset" value="RESET" />
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top