title: Check if PrimeFaces widgetVar exists
body: <p>I have a Primefaces commandButton, that calls a datatable filter in its onComplete. The datatable is referenced by a widgetVar:</p>
  
  <pre><code>&lt;p:commandButton id="addFishBtn" 
                      title="Add Fish"
                      update="fishForm:FishTbl"
                      action="#{backingBean.addFish()}" 
                      oncomplete="fishTable.filter()"/&gt;
  </code></pre>
  
  <p>The problem is, that fishTable doesn't always exist when this button is pressed. It it doesn't exist, the app just gets stuck. I tryed something like this from other SO questions:</p>
  
  <pre><code>oncomplete="if(typeof(fishTable) != 'undefined') {fishTable.filter()}"
  </code></pre>
  
  <p>But it doesn't seem to be doing anything. Is there any proper way to check if a widgetVar currently has any value?<br>
  Thanks!</p>