I am using widgetVar to enable a command button through javascript on some event. However after enabling command button, when I click the button, the form is not submitted and action is not called on server side.
The same setup works fine if I don's use widgetVar and keep button enabled by default. It submits the funciton, calls the actions and displays the result.
FYI, I am using ajax call.
<p:commandButton id="btnSearch" value="Search" disabled="true"
widgetVar="searchButton"
ajax="true"
action="#{someBean.someFunction(someBean.firstName, someBean.lastName)}">
<p:ajax
execute="firstName lastName"
render="tabViewId:resultsDataTableId"
onsuccess="showSearchResults()"/>
</p:commandButton>
Javascript -
function onSomeEvent(){
PF('searchButton').enable();
}
Please advice.