h:commandButton/h:commandLink does not work on first click, works only on second click

You can use the following script to fix the Mojarra 2.0/2.1/2.2 bug (note: this doesn’t manifest in MyFaces). This script will create the javax.faces.ViewState hidden field for forms which did not retrieve any view state after ajax update. jsf.ajax.addOnEvent(function(data) { if (data.status == “success”) { fixViewState(data.responseXML); } }); function fixViewState(responseXML) { var viewState = getViewState(responseXML); … Read more

How can I pass selected row to commandLink inside dataTable or ui:repeat?

As to the cause, the <f:attribute> is specific to the component itself (populated during view build time), not to the iterated row (populated during view render time). There are several ways to achieve the requirement. If your servletcontainer supports a minimum of Servlet 3.0 / EL 2.2, then just pass it as an argument of … Read more

commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated

Introduction Whenever an UICommand component (<h:commandXxx>, <p:commandXxx>, etc) fails to invoke the associated action method, or an UIInput component (<h:inputXxx>, <p:inputXxxx>, etc) fails to process the submitted values and/or update the model values, and you aren’t seeing any googlable exceptions and/or warnings in the server log, also not when you configure an ajax exception handler … Read more