title: Xpages: Search box for data table
body: <p>i have a DataTable on my Xpage. I´ve filled with JavaScript an array with elements from 4 Notes Databases, which i´ve returned to the Table to show it on the DataTable.</p>
  
  <p>This works, but now i need a search (edit box with search button) to search and update the results in the DataTable.</p>
  
  <p>Is this possible? I only found a solution for a datatable, which is directly bind to a view, and nothing for a "manually" filled DataTable.</p>
  
  <p>This is my Datatable code , which includes the JS code to create the array</p>
  
  <pre><code>&lt;xp:dataTable id="dataTable3" rows="990" var="coll2Test"
                  style="width:70%" indexVar="idx"&gt;
  
  
                  &lt;xp:this.facets&gt;
                      &lt;xp:pager partialRefresh="true"
                          layout="Previous Group Next" 
  xp:key="header" id="pager8"&gt;
                      &lt;/xp:pager&gt;
                  &lt;/xp:this.facets&gt;
  
  
                  &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:
  
  
  var fa:NotesDatabase = session.getDatabase(@DbName()[0], "???????");
  var faSh:NotesDatabase = session.getDatabase(@DbName()[0],"???????");
  var faKb:NotesDatabase = session.getDatabase(@DbName()[0],"???????");
  var fa20:NotesDatabase = session.getDatabase(@DbName()[0],"???????");
  
  
  var vFa:NotesView = fa.getView("???????");
  var vSh:NotesView = faSh.getView("???????");
  var vKb:NotesView = faKb.getView("????????");
  var v20:NotesView = fa20.getView("???????");
  
  
  var doc:NotesDocument = vFa.getFirstDocument();
  var docSh:NotesDocument = vSh.getFirstDocument();
  var docKb:NotesDocument = vKb.getFirstDocument();
  var doc20:NotesDocument = v20.getFirstDocument();
  
  
  var faArr= new Array();
  
  
  while(doc!= null) {
  
  var eintrag = new Array();
  eintrag.push(doc.getItemValue("Name"));
  eintrag.push(doc.getItemValue("Description"));
  
  faArr.push(eintrag)
  
  doc = vFa.getNextDocument(doc);
  
  
  }
  
  while(docSh!= null) {
  
  var eintrag = new Array();
  eintrag.push(docSh.getItemValue("Name"));
  eintrag.push(docSh.getItemValue("Description"));
  
  faArr.push(eintrag)
  
  docSh = vSh.getNextDocument(docSh);
  
  }
  
  ..... 
  //another 2 while
  ...
  
  
  
  
  return faArr;}]]&gt;&lt;/xp:this.value&gt;&lt;xp:table&gt;
                      &lt;xp:tr&gt;
                          &lt;xp:td&gt;
                              &lt;xp:label 
  value="Suche:"     id="label14"
  
  
  style="font-        weight:bold"&gt;
                              &lt;/xp:label&gt;
                          &lt;/xp:td&gt;
                          &lt;xp:td&gt;
                              &lt;xp:inputText    
  id="inputText7"
                                  value="#
  {viewScope.searchView6}"&gt;
  
  
                              &lt;/xp:inputText&gt;
                          &lt;/xp:td&gt;
                          &lt;xp:td&gt;
                              &lt;xp:button value="suchen"
                                  id="button7"&gt;
                                  &lt;xp:eventHandler 
  event="onclick"
  
  
  submit="true" refreshMode="complete" immediate="false"
  
  save="true" id="eventHandler7"&gt;
                                  &lt;/xp:eventHandler&gt;
                              &lt;/xp:button&gt;
                          &lt;/xp:td&gt;
                      &lt;/xp:tr&gt;
                  &lt;/xp:table&gt;
  
  
  
  
  
  
  
  
  
                  &lt;xp:column id="column6"&gt;
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label11" 
  xp:key="header"
  
  style="color:rgb(0,128,255);font-weight:bold"
                              value="Name"&gt;
  
                          &lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                      &lt;xp:text escape="false" 
  id="computedField5"&gt;
  
  
                          &lt;xp:this.value&gt;&lt;![CDATA[#
  {coll2Test[0]}]]&gt;&lt;/xp:this.value&gt;
                      &lt;/xp:text&gt;
                  &lt;/xp:column&gt;
                  &lt;xp:column id="column7"&gt;
                      &lt;xp:this.facets&gt;
                          &lt;xp:label id="label12" 
  xp:key="header"
  
  style="color:rgb(0,128,255);font-weight:bold"
                              value="Description"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:this.facets&gt;
                      &lt;xp:text escape="true" id="computedField6"&gt;
  
                          &lt;xp:this.value&gt;&lt;![CDATA[#
  {coll2Test[1]}]]&gt;&lt;/xp:this.value&gt;
                      &lt;/xp:text&gt;
                  &lt;/xp:column&gt;
  
              &lt;/xp:dataTable&gt;
  </code></pre>
  
  <p>Regards</p>
  
  <p>Stefan</p>