title: Why this dialog doesn't pop up?(JSF2.0+PRIMEFACES)
body: <p>I want to make a dialog pop up when i click on a table row, but it doesnt work.(primefaces components p:dataTable and p:dialog) Also it looks like the selectioMode doesnt work correctly. Why is this happening?</p>
  
  <p>The JSF page:</p>
  
  <pre><code>&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:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:t="http://myfaces.apache.org/tomahawk"
  xmlns:p="http://primefaces.prime.com.tr/ui"&gt;
      &lt;ui:composition template="WEB-INF/templates/BasicTemplate.xhtml"&gt;
  &lt;ui:define name="resultsForm2"&gt;
  &lt;h:form enctype="multipart/form-data"&gt;              
      &lt;p:dataTable var="garbage" value="#{resultsController.allGarbage}"  dynamic="true" paginator="true" paginatorPosition="bottom" rows="10"
                       paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink}  {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                       rowsPerPageTemplate="5,10,15" selection="#{resultsController.selectedGarbage}" selectionMode="single"
                        onRowSelectStart="fileDialog.show()"&gt;
              &lt;p:column&gt;
                  &lt;h:outputText value="#{garbage.filename}"/&gt;
              &lt;/p:column&gt;
          &lt;/p:dataTable&gt;            
      &lt;/h:form&gt;
      &lt;p:dialog widgetVar="fileDialog"&gt;
          &lt;h:outputText value="Dialog open"/&gt;
      &lt;/p:dialog&gt;   
  &lt;/ui:define&gt;
     &lt;/ui:composition&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here the managed bean:</p>
  
  <pre><code>   @ManagedBean
     @ViewScoped
     public class ResultsController implements Serializable{
  @EJB
  private ISearchEJB searchEJB;
  
  private Garbage garbage;
  
  private List&lt;Garbage&gt; allGarbage;
  
  private Garbage selectedGarbage;
  
  public List&lt;Garbage&gt; getAllGarbage() {
  
      allGarbage = new ArrayList&lt;Garbage&gt;();
      for(Garbage g :searchEJB.findAllGarbage()) {
          allGarbage.add(g);
      }
      return allGarbage;
  }   
  
  public void setAllGarbage(List&lt;Garbage&gt; allGarbage) {
      this.allGarbage = allGarbage;
  }
  
  
  public Garbage getGarbage() {
      return garbage;
  }
  
  public void setGarbage(Garbage garbage) {
      this.garbage = garbage;
  }   
  
  public void onRowSelect(SelectEvent event){ 
      garbage = (Garbage)event.getObject(); 
  }
  
  public Garbage getSelectedGarbage() {
      return selectedGarbage;
  }
  
  public void setSelectedGarbage(Garbage selectedGarbage) {
      this.selectedGarbage = selectedGarbage;
  }   
  </code></pre>
  
  <p>Also notice that in the output i can see the values but when i click on a row it gets colored but no dialog pops up(Also i looks like i can click on more than one row, that is not supposed to be like that since i use selectionMode="single"):
  <img src="https://i.stack.imgur.com/OPBfl.png" alt="enter image description here"></p>