title: Call Dialog from ManagedBean now showing PrimeFaces 5
body: <p>What I need to do call I dialog from a ManagedBean, exactly like this show case:
  <a href="http://www.primefaces.org/showcase/ui/df/basic.xhtml" rel="nofollow">http://www.primefaces.org/showcase/ui/df/basic.xhtml</a></p>
  
  <p>It looks very trivial but I'm new to JSF and maybe there is something the showcase assumes I should know to make it work.</p>
  
  <p>what I did was quite similar to showCase:</p>
  
  <p>file myDialog.xhtml</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"&gt;
  &lt;h:head&gt;
      &lt;title&gt;Dialog Test&lt;/title&gt;
      &lt;style type="text/css"&gt;
  .ui-widget {
      font-size: 90%;
  }
  &lt;/style&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h1&gt;Dialog Working&lt;/h1&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In the page "client" page:</p>
  
  <pre><code>&lt;p:commandButton value="Open Dialog" ajax="true"
                  actionListener="#{testMB.open}"
                   /&gt;
  
  public void open() {
              RequestContext.getCurrentInstance().openDialog("myDialog");
  }
  </code></pre>
  
  <p>When I try to call the dialog nothing happens! </p>
  
  <p>In the Firebug Console I got the "Widget for var 'widget_frmBody_j_idt88' not available!" </p>
  
  <p>I noticed the .xhtml file from showCase does not have a  so I tried this approach:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"&gt;
  
      &lt;p:dialog widgetVar="testDialog"&gt;
          &lt;h1&gt;This is a Dialog&lt;/h1&gt;
  
      &lt;/p:dialog&gt;
  
  &lt;/html&gt;
  
  RequestContext rc = RequestContext.getCurrentInstance();
  rc.execute("PF('testDialog').show()");
  </code></pre>
  
  <p>And I got: </p>
  
  <p>TypeError: PF(...) is undefined jquery.js:1
  "Widget for var 'testDialog' not available!"</p>
  
  <p>What can I do to make it works please???</p>