user5372077
user5372077

Reputation:

Reset DropDown,check box in primefaces not working?

DropDown Box code:

<p:selectOneMenu id="user" value="#{daywise_Count.selectuserId}" style="width:120px">
    <f:selectItem itemLabel="All" itemValue="0" />
    <f:selectItems value="#{daywise_Count.getAllLoginIds()}"                                            var="uif" itemLabel="#{uif.loginId}" itemValue="#{uif.userId} " />
</p:selectOneMenu>

CheckBox code:

<p:selectBooleanCheckbox  id="checkbox" value="#{deptBean.checkboxvalue}" /> With All Details

reset function:

function resetter()
{
    document.getElementById('myForm:myMenu_label').innerHTML = 'All';

}

Calling Reset Function

    <h:commandButton id="btnReset" value="Reset" update="myForm" onclick="resetter();" 
styleClass="button" type="submit"> 
</h:commandButton> 

I am using reset button in myForm that functionality is not working properly in primefaces.please suggest any solution...

Upvotes: 0

Views: 1000

Answers (1)

Piyush Gupta
Piyush Gupta

Reputation: 2179

you should try this <p:commandButton id="btnReset" value="Reset" update="myForm" process="@this" /> this is working for me, I hope it will help you too. and no need to java script.

update="myForm" attribute means it will update your panel because here you will use panel id and process="@this" means it will execute same content after click on reset button for further details you can search on google or refer this link What is the function of @this exactly?

Upvotes: 1

Related Questions