Hi guys i have some input boxes where a user can enter details and submit it, this is requried to have some validation, not null etc this is working all fine, however i have a navigation button to go home if the user has come to this page by mistake or something, however when a user presses this button it also calls the validation and requires the user to enter details, which for a home button is no good, is there any way i can not have the validation run when a user presses this button ? it is a primefaces command button
here is the code, if i use a link i can navigate fine, but for user experience i would rather use a command button
<h:form>
<p:growl id="growl" showDetail="true" sticky="true" />
<!--ajax messages working now -->
<p:panel header="Enter details">
<h:panelGrid columns="2">
<h:outputLabel value="#{bundle.CreateUserdetailsLabel_id}" for="id" />
<h:inputText id="id" value="#{userdetailsController.selected.id}" title="#{bundle.CreateUserdetailsTitle_id}" required="true" requiredMessage="#{bundle.CreateUserdetailsRequiredMessage_id}"/>
<h:outputLabel value="#{bundle.CreateUserdetailsLabel_username}" for="username" />
<h:inputText id="UserName" value="#{userdetailsController.selected.username}" title="#{bundle.CreateUserdetailsTitle_username}" required="true"
requiredMessage="Username is required"
label="UserName" >
<f:validator validatorId="richard.validator.UserNameValidator" />
</h:inputText>
</h:panelGrid>
<br />
<p:commandButton action="#{userdetailsController.create}" value="#{bundle.CreateUserdetailsSaveLink}" update="growl"/>
<br />
<br />
<p:commandButton action="#{userdetailsController.prepareList}" value="#{bundle.CreateUserdetailsShowAllLink}" immediate="true"/>
</p:panel>
<br />
<br />
<!--
Trying to use a command button to navigate however it is requiring the user enter details first and this is not acceptable so looking for a solution
<p:commandButton action="{naviagation.buttonHome}" value="Home" icon ="ui-icon-home" ajax="False"/>
<p:commandButton action="{bundle.ListUserdetailsIndexLink}" value="List of all current records" icon ="ui-icon-person" ajax="False"/>
-->
<h:link outcome="/index" value="#{bundle.ListUserdetailsIndexLink}"/>
</h:form>
thanks