title: update panel in the same page jsf
body: <p>Hi I´m doing a document managment system with primefaces 5. y made a search feature, the search buton is located in the template in the left side menu, the results of the search are showed in the center unit layout. the searching feature run good if I search , but when Im whatching the results and try to search again the results are not refreshed</p>
  
  <p>my template file </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:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.org/ui"&gt;
  
  &lt;f:view contentType="text/html"&gt;
      &lt;h:head&gt;
          &lt;f:facet name="first"&gt;
              &lt;meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/&gt;
              &lt;title&gt;Sysged&lt;/title&gt;
              response.setHeader("Content-Disposition", "inline");
          &lt;/f:facet&gt;
      &lt;/h:head&gt;
  
      &lt;h:body&gt;
  
          &lt;p:layout fullPage="true"&gt;
  
              &lt;p:layoutUnit position="north" size="100" resizable="true" closable="true"collapsible="true"&gt;     
                  &lt;h:graphicImage library="images" name="logo.png" &gt;&lt;/h:graphicImage&gt;
                   &lt;h:graphicImage library="images" name="footer.jpg" &gt;&lt;/h:graphicImage&gt;
              &lt;/p:layoutUnit&gt;
  
  
  
              &lt;p:layoutUnit position="west" size="270" header="Main menu"   collapsible="true" resizable="true"&gt;
              &lt;h:form&gt;
              &lt;p:menu&gt;
  
                  &lt;p:submenu label="Import"&gt;
                      &lt;p:menuitem value="Local" icon="ui-icon-disk"   url="UIlocalImport.xhtml"/&gt;
                      &lt;p:menuitem value="URL" icon="ui-icon-arrowrefresh-1-w"
                          url="UIlurlImport.xhtml" /&gt;
                  &lt;/p:submenu&gt;
                  &lt;p:submenu label="Search"&gt;
                      &lt;p:menuitem&gt;
                          &lt;h:panelGrid columns="3" cellpadding="5"
                              style="margin-bottom:10px"&gt;
  
                              &lt;p:inputText id="paramSearch" value="# {documentBean.paramSearch}"
                                  required="true" label="Keyword"  /&gt;
                              &lt;p:watermark for="paramSearch" value="Search with a keyword"
                                  id="watermark" /&gt;
                          &lt;/h:panelGrid&gt;
  
                          &lt;p:commandButton action="#{documentBean.search2}"  value="Search"  update=":content"/&gt;
  
                      &lt;/p:menuitem&gt;
  
                  &lt;/p:submenu&gt;
  
  
  
                  &lt;p:submenu label="Administrator"&gt;
                      &lt;p:menuitem value="Category manager" url="UIadminCategories.xhtml"&gt;
                      &lt;/p:menuitem&gt;
  
                      &lt;p:submenu label="Close sesion"&gt;
                          &lt;p:menuitem&gt;
                              &lt;p:commandButton action="#{userBean.logout}" value="exit"
                                  icon="ui-icon-close" /&gt;
                          &lt;/p:menuitem&gt;
                      &lt;/p:submenu&gt;
  
                  &lt;/p:submenu&gt;
  
              &lt;/p:menu&gt;
              &lt;/h:form&gt;
              &lt;/p:layoutUnit&gt;
  
              &lt;p:layoutUnit position="center"&gt;
              &lt;h:panelGroup id="content" &gt;
                  &lt;ui:insert  name="UIlocalImport" &gt;&lt;/ui:insert&gt;
  
                  &lt;ui:insert name="Uisearch"&gt;&lt;/ui:insert&gt;
                  &lt;ui:insert name="UiadminCategories"&gt;&lt;/ui:insert&gt;
                  &lt;ui:insert name="UIlurlImport"&gt;&lt;/ui:insert&gt;
                  &lt;/h:panelGroup&gt;
              &lt;/p:layoutUnit&gt;
  
          &lt;/p:layout&gt;
  
      &lt;/h:body&gt;
  
     &lt;/f:view&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>One of the xhtml where I can search</p>
  
  <pre><code>&lt;ui:define name="UIlurlImport"&gt;
  
      &lt;h:panelGrid columns="1" cellpadding="5"&gt;
          &lt;h:form&gt;
              &lt;p:growl id="messages" showDetail="true" /&gt;
  
              &lt;p:panel id="panel" header="URL import" syle="vertical-align:top;"&gt;
  
                  &lt;p:outputLabel for="url" value="URL" /&gt;
                  &lt;p:inputText id="url" value="#{urlImportBean.url}" required="true"
                      label="URL"&gt;
                      &lt;f:validateLength minimum="5" /&gt;
                      &lt;p:ajax update="msgOutput" event="keyup" /&gt;
                  &lt;/p:inputText&gt;
                  &lt;p:message for="category" id="msgOutput" display="icon" /&gt;
                  &lt;p:outputLabel for="category" value="Category" style="padding:10px" /&gt;
                  &lt;p:selectOneMenu id="category" value="#{urlImportBean.category}"
                      label="category" filter="true"&gt;
                      &lt;f:selectItems value="#{categorieBean.items}" id="selectCategoy" /&gt;
                      &lt;p:ajax /&gt;
                  &lt;/p:selectOneMenu&gt;
                  &lt;p:commandButton value="Import" update="messages"
                      icon="ui-icon-home" action="#{urlImportBean.importImage}" /&gt;
  
              &lt;/p:panel&gt;
          &lt;/h:form&gt;
  
  
       &lt;/h:panelGrid&gt;
      &lt;/ui:define&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>where the results are displayed but if I search, nothing is updated</p>
  
  <pre><code>&lt;ui:define name="Uisearch"&gt;
      &lt;h:outputScript library="js" name="pdfobject.js" target="head" /&gt;
      &lt;h:panelGrid columns="1" cellpadding="2"&gt;
  
          &lt;p:panel id="panelResults" header="Results"&gt;
  
              &lt;p:dataList value="#{documentBean.documentsMatched}" var="document"
                  type="definition"&gt;
  
                  &lt;h:outputLink value="file/#{document.pdfPath}" target="_blank"&gt;view  document&lt;/h:outputLink&gt;   
                  &lt;div id="pdf2"&gt;
                      &lt;object data='file/#{document.pdfPath}' type='application/pdf'
                          width='1000px' height='400px'&gt;
  
                          &lt;p&gt;
                              It appears your Web browser is not configured to display  PDF
                              files. No worries, just &lt;a href='file/#  document.pdfPath}'&gt;click
                                  here to download the PDF file.&lt;/a&gt;
                          &lt;/p&gt;
  
                      &lt;/object&gt;
                  &lt;/div&gt;
  
  
              &lt;/p:dataList&gt;
  
           &lt;/p:panel&gt;
  
       &lt;/h:panelGrid&gt;
  
    &lt;/ui:define&gt;
  
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>the method that the boton calls</p>
  
  <pre><code>    public String search2()
   {
      System.out.println("searching "+ paramSearch);
  
      DocumentModel doc = new DocumentModel();
      this.setDocumentsMatched(doc.searchText(this.paramSearch));
      System.out.println("search");
      return "UIsearch";
  
  }
  </code></pre>
  
  <p>Thanks in advance for your time and aswers</p>