Hi i´m using Primefaces 2.2.1. When I try to use jQuery it works fine the first time. If I change de value of the select box with ID "parentMenu" it will show the alert. Now if I submit the page and it returns to the same page because validations failed and try to change the value of the select box the alert will not show anymore.
Anyone knows why jQuery stops working? Thanks.
jQuery('select[id*="parentMenu"]').change(function () {
alert('worked');
});
Here´s my Primefaces submit button:
<p:commandButton id="btSave" value="Save" update="msgs, itensForm" actionListener="#{itensBean.save}" style开发者_C百科="margin-left:5px;" />
Try to change your jQuery code to be like this:
jQuery('select[id*="parentMenu"]').live(function () {
alert('worked');
});
精彩评论