0 Replies Latest reply on Oct 6, 2010 8:34 AM by nuuh

    javascript array and rich:datatable

    nuuh
      Hi,

      In my page, I want to set backing bean's list elements into datatable and also into a javascript array. My sample page is below, I can display list with the rich:datatable but I couldn't find out how to set those values into javscript array. Could you help me about this problem.

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      template="/layout/template.xhtml">



      <ui:define name="body">
      <script>
      function test() {
        var myCars=["Name1","Name2","Name3"]
      }
      </script>

      <h:form>   

                       <rich:dataTable value="#{myBean.myList}" var="myVar" >
                      <f:facet name="header">
                          <h:outputText value="Name" />
                          <h:outputText value="#{myVar.name}" />
                      </f:facet>
                       </rich:dataTable>
      </h:form>

      </ui:define>
      </ui:composition>