You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sc...@apache.org on 2005/04/13 22:08:38 UTC

cvs commit: incubator-myfaces/webapps/simple openDataTable.jsp home.jsp

schof       2005/04/13 13:08:38

  Modified:    webapps/simple/WEB-INF examples-config.xml
               webapps/simple home.jsp
  Added:       webapps/simple openDataTable.jsp
  Log:
  Added a new example that shows x:dataTable, x:column and x:dataScroller all working together (example by Chris Barlow)
  
  Revision  Changes    Path
  1.5       +8 -0      incubator-myfaces/webapps/simple/WEB-INF/examples-config.xml
  
  Index: examples-config.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/simple/WEB-INF/examples-config.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- examples-config.xml	12 Apr 2005 20:32:33 -0000	1.4
  +++ examples-config.xml	13 Apr 2005 20:08:38 -0000	1.5
  @@ -252,6 +252,14 @@
           <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
   
  +    <!-- Managed Beans for openDataTable.jsp -->
  +
  +    <managed-bean>
  +        <managed-bean-name>openDataList</managed-bean-name>
  +        <managed-bean-class>org.apache.myfaces.examples.listexample.OpenDataList</managed-bean-class>
  +        <managed-bean-scope>session</managed-bean-scope>
  +    </managed-bean>
  +
       <navigation-rule>
           <navigation-case>
               <from-outcome>go_home</from-outcome>
  
  
  
  1.4       +1 -0      incubator-myfaces/webapps/simple/home.jsp
  
  Index: home.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/simple/home.jsp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- home.jsp	12 Apr 2005 20:32:33 -0000	1.3
  +++ home.jsp	13 Apr 2005 20:08:38 -0000	1.4
  @@ -30,6 +30,7 @@
           &nbsp;&nbsp;&nbsp;<h:outputLink value="dataScroller.jsf" ><f:verbatim>Data Scroller</f:verbatim></h:outputLink><br/>            
           &nbsp;&nbsp;&nbsp;<h:outputLink value="sortTable.jsf" ><f:verbatim>Sortable</f:verbatim></h:outputLink><br/>            
           &nbsp;&nbsp;&nbsp;<h:outputLink value="pagedSortTable.jsf" ><f:verbatim>Paged and Sortable</f:verbatim></h:outputLink><br/>            
  +        &nbsp;&nbsp;&nbsp;<h:outputLink value="openDataTable.jsf" ><f:verbatim>Paged and Sortable (dynamic number of columns)</f:verbatim></h:outputLink><br/>
           <h:outputLink value="selectbox.jsf" ><f:verbatim>Select boxes</f:verbatim></h:outputLink> <br/>
           <h:outputLink value="fileupload.jsf" ><f:verbatim>File upload</f:verbatim></h:outputLink> <br/>
           <h:outputLink value="tabbedPane.jsf" ><f:verbatim>Tabbed Pane</f:verbatim></h:outputLink> <br/>
  
  
  
  1.1                  incubator-myfaces/webapps/simple/openDataTable.jsp
  
  Index: openDataTable.jsp
  ===================================================================
  <%@ page session="false" contentType="text/html;charset=utf-8"%>
  <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
  <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
  <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
  <html>
  
  <!--
  /*
   * Copyright 2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  //-->
  
  <%@include file="inc/head.inc" %>
  
  <body>
  
  <!--
  managed beans used:
      countryList
  -->
  
  <f:view>
  
      <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
  
      <x:dataTable id="data"
                   styleClass="scrollerTable"
                   headerClass="standardTable_Header"
                   footerClass="standardTable_Header"
                   rowClasses="standardTable_Row1,standardTable_Row2"
                   columnClasses="standardTable_Column,standardTable_ColumnCentered, standardTable_Column"
                   var="row"
                   value="#{openDataList.data}"
                   preserveDataModel="true"
                   rows="10"
                   sortColumn="#{openDataList.sort}"
                   sortAscending="#{openDataList.ascending}"
                   preserveSort="true">
          <x:columns value="#{openDataList.columnHeaders}" var="columnHeader">
              <f:facet name="header">
                  <x:commandSortHeader columnName="#{columnHeader}" arrow="true">
                      <h:outputText value="#{columnHeader}" />
                  </x:commandSortHeader>
              </f:facet>
              <!-- row is also available -->
              <h:outputText value="#{openDataList.columnValue}" />
          </x:columns>
      </x:dataTable>
  
      <h:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered" >
          <x:dataScroller id="scroll_1"
                          for="data"
                          fastStep="10"
                          pageCountVar="pageCount"
                          pageIndexVar="pageIndex"
                          styleClass="scroller"
                          paginator="true"
                          paginatorMaxPages="9"
                          paginatorTableClass="paginator"
                          paginatorActiveColumnStyle="font-weight:bold;">
              <f:facet name="first" >
                  <h:graphicImage url="images/arrow-first.gif" border="1" />
              </f:facet>
              <f:facet name="last">
                  <h:graphicImage url="images/arrow-last.gif" border="1" />
              </f:facet>
              <f:facet name="previous">
                  <h:graphicImage url="images/arrow-previous.gif" border="1" />
              </f:facet>
              <f:facet name="next">
                  <h:graphicImage url="images/arrow-next.gif" border="1" />
              </f:facet>
              <f:facet name="fastforward">
                  <h:graphicImage url="images/arrow-ff.gif" border="1" />
              </f:facet>
              <f:facet name="fastrewind">
                  <h:graphicImage url="images/arrow-fr.gif" border="1" />
              </f:facet>
          </x:dataScroller>
  
      </h:panelGrid>
  
  </f:view>
  
  </body>
  
  </html>