3 Replies Latest reply on Jul 6, 2007 7:07 AM by pakhi

    Using DataList in JSF

    pakhi

      Want to populate a grid stucture with defined no. of rows and columns.

        • 1. Re: Using DataList in JSF
          pakhi

           

          "pakhi" wrote:
          Wants to populate a grid stucture with defined no. of rows and columns.



          I am trying to use the t:datalist control in <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

          My data is fetched from the backing bean. My JSF is as follows:

          <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
          <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
          <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
          <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

          <f:view>



          <t:outputText value="Testing"/>
          <t:outputText value="Testing//"/>
          <f:verbatim>

          <%int c =1;
          System.err.println("1111111111111111111111111****************"); %>
          <t:dataList value="#{registerBean.books}" var="book"
          id="horzNav" layout="grid" >
          <f:verbatim>


          <t:commandLink action="#{registerBean.institutions}">
          <t:outputText value="#{book.ISBN}" />
          </t:commandLink>
          <t:outputText value="Testing"/>
          <t:commandLink action="#{registerBean.institutions}">
          <t:outputText value="#{book.title}"/>
          </t:commandLink>
          <f:verbatim>
          </f:verbatim>
          </f:verbatim>

          <%

          if(c == 3)
          {
          System.err.println("dgsahfashfasjfasfafs****************");%>
          <f:verbatim>
          </f:verbatim>
          <%}else{
          System.err.println("(((((((((((: "+c);
          }
          c = c+1;
          System.err.println("(((((((((((: "+c);
          %>
          </t:dataList>

          </f:verbatim>



          </f:view>

          I am not able to run sciptelts in between the t:datalist tag, though it is read only once but i am not able to increment the value of the count variable "c".
          My aim is to populate my data in the form of 3 columns and n rows.

          Please let me know if my approach of using the t:datalist is correct or not. I failed to use <h:panelgrid> and <h:datatable>

          Please reply.
          Thanks in advance.


          • 2. Re: Using DataList in JSF
            ilya_shaikovsky

            I think you've choosen wrong forum and wrong branch.

            • 3. Re: Using DataList in JSF
              pakhi

              Please reply if you know the answer, or can u guide me to right forum?