In my JSF 2 web application, I use the following code to display and switch rich content: dataTable according to the selected status:
<h:selectOneRadio id="statusSelection" value="#{backingBean.selectedStatus}" style="width:auto; float:left;"> <f:selectItem itemValue="AVAILABLE" itemLabel="Available" /> <f:selectItem itemValue="INACTIVE" itemLabel="Inactive" /> <f:ajax render="itemsDataTable" execute="#{backingBean.sortByTitel('ascending')}" /> <f:ajax render="itemsDataTable" event="click" /> </h:selectOneRadio>
The DataTable contains a4j: commandLink s, which inadvertently needs to be double-clicked in some versions of IE after changing the contents of the table - I found out that running the following Javascript (on the IE debugging console after changing the contents of the table) solves the problem:
document.getElementById(<dataTableClientId>).focus()
My question is: how can I get javascript code to execute automatically after changing the contents of a table?
javascript ajax jsf
Mr.Radar
source share