title: Can't show a primefaces panel with onclick
body: <p>I'm trying to show a p:panel with a <code>widgetVar</code> and <code>onclick</code> but it only shows up for like a split second. Then it hides again.
  When it hides again I get the following error-message in the browser development console:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'val' of undefined
  </code></pre>
  
  <p>The error also shows up only for a split second.</p>
  
  <p>This is my .xhtml page:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html   xmlns  ="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"  
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:p="http://primefaces.org/ui"&gt;
  
      &lt;h:head&gt;
          &lt;h:outputStylesheet library="css" name="style.css" /&gt;
          &lt;h:outputScript name="jquery/jquery.js" library="primefaces"/&gt;  
      &lt;/h:head&gt;
  
      &lt;h:body&gt;
          &lt;h:form&gt;
              &lt;p:commandButton value="testbutton" ajax="false" onclick="PF('panelwv').show();" /&gt;
              &lt;p:panel widgetVar="panelwv" visible="false" toggleable="true"&gt;
                  &lt;h:outputText value="Test" /&gt;
              &lt;/p:panel&gt;
          &lt;/h:form&gt;
      &lt;/h:body&gt;                   
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm using Primefaces 5.2.</p>