0

Very simple dialog. I want a method to be called when it is closed by clicking on the x. However the listener is not called. It's not in the generated source code either. I'm using Primefaces 2.1 with Glassfish4.

xhtml:

<h:body>
<p:dialog visible="true" closeListener="#{variances.closeDetail}" >
Hi there!
</p:dialog>
</h:body>

java:

@Named("variances")
@SessionScoped
public class Variances implements Serializable {
public void closeDetail(CloseEvent event) {
    Log.trace("Variances", "closeDetail called");
}
}

generated source:

<script type="text/javascript">
jQuery(function() {
widget_j_idt6 = new PrimeFaces.widget.Dialog(
'j_idt6',
{autoOpen:true,minHeight:0,ajaxClose:true,url:'/MetricsMonitor/binh.jsf'});});
</script>

Any idea ? I can't use p:ajax because I then get the "Parent not an instance of ClientBehaviorHolder" error.

TIA. Binh

Binh
  • 99
  • 12
  • More info:It seems to die here in core.js.jsf because document.getElementById(PrimeFaces.VIEW_STATE) is null -- PrimeFaces.ajax.AjaxUtils = { encodeViewState: function () { var a = document.getElementById(PrimeFaces.VIEW_STATE).value; var c = new RegExp('\\+', 'g'); var b = a.replace(c, '%2B'); return b }, – Binh Dec 22 '15 at 18:22
  • Tried putting it in a form? And btw PF 2.1? – Kukeltje Dec 22 '15 at 18:53
  • Yes it is already in a form. Primefaces 2.1. I noticed also that it also doesn't work for p:tab if I make it dynamic=true. Same exception. – Binh Dec 29 '15 at 16:38
  • I should also say that all of this code used to work until I upgrade from Glassfish3 to Glassfish4. – Binh Dec 29 '15 at 17:32
  • 1
    Maybe the jsf version in GF4 is to new for PrimeFaces 2.1? – Kukeltje Dec 29 '15 at 18:15

0 Answers0