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

cvs commit: incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc TestCheckBoxList.java

svieujot    2005/02/08 13:56:45

  Modified:    webapps/examples/web/WEB-INF examples-config.xml
               webapps/examples/web tabbedPane.jsp
  Added:       webapps/examples/src/org/apache/myfaces/examples/misc
                        TestCheckBoxList.java
  Log:
  Add an x:dataTable with embeded h:selectBooleanCheckbox to the tabbedPane example.
  
  Revision  Changes    Path
  1.45      +6 -0      incubator-myfaces/webapps/examples/web/WEB-INF/examples-config.xml
  
  Index: examples-config.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/WEB-INF/examples-config.xml,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- examples-config.xml	8 Feb 2005 16:48:28 -0000	1.44
  +++ examples-config.xml	8 Feb 2005 21:56:45 -0000	1.45
  @@ -205,6 +205,12 @@
           <managed-bean-class>org.apache.myfaces.examples.misc.TestCheckBox</managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
       </managed-bean>
  +    
  +	<managed-bean>
  +        <managed-bean-name>testCheckList</managed-bean-name>
  +        <managed-bean-class>org.apache.myfaces.examples.misc.TestCheckBoxList</managed-bean-class>
  +        <managed-bean-scope>request</managed-bean-scope>
  +    </managed-bean>
   
       <managed-bean>
           <managed-bean-name>testRadioButton</managed-bean-name>
  
  
  
  1.24      +18 -3     incubator-myfaces/webapps/examples/web/tabbedPane.jsp
  
  Index: tabbedPane.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/tabbedPane.jsp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- tabbedPane.jsp	8 Feb 2005 16:48:28 -0000	1.23
  +++ tabbedPane.jsp	8 Feb 2005 21:56:45 -0000	1.24
  @@ -88,13 +88,28 @@
   							<f:selectItem itemValue="0" itemLabel="First Choice" />
   							<f:selectItem itemValue="1" itemLabel="Second Choice" />
                           </x:selectOneRadio>
  +                        
   	                    <f:verbatim><br/><br/></f:verbatim>
  +
  +	                    <x:dataTable value="#{testCheckList.testCheckBoxes}"
  +	                    			var="checkBox"
  +	                    			preserveDataModel="true"
  +	                    			rowIndexVar="rowNumber">
  +							<h:column>
  +								<f:facet name="header">
  +									<h:outputText value="Check boxes list" />
  +								</f:facet>
  +								<h:selectBooleanCheckbox value="#{checkBox.checked}"/>
  +								<h:outputText value="Check box #{rowNumber}"/>
  +							</h:column>
  +		                </x:dataTable>
  +		                
  +						<f:verbatim><br/><br/></f:verbatim>
  +
                           <h:inputText id="inp3"/><f:verbatim><br/></f:verbatim>
  -                        <h:inputText id="inp4"/><f:verbatim><br/></f:verbatim>
  -                        <h:inputText id="inp5"/><f:verbatim><br/></f:verbatim>
                       </x:panelTab>
   
  -                    <f:verbatim><br></f:verbatim>
  +                    <f:verbatim><br/><hr/><br/></f:verbatim>
   
                       <h:selectBooleanCheckbox value="#{tabbedPaneBean.tab1Visible}"/>
                       <h:outputText value="#{example_messages['tabbed_visible1']}"/>
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/TestCheckBoxList.java
  
  Index: TestCheckBoxList.java
  ===================================================================
  /*
   * 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.
   */
  package org.apache.myfaces.examples.misc;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
   * @version $Revision: 1.1 $ $Date: 2005/02/08 21:56:45 $
   */
  public class TestCheckBoxList
  {
      private List testCheckBoxes;
      
      public TestCheckBoxList(){
          testCheckBoxes = new ArrayList(3);
          
          for(int i=0 ; i<3 ; i++)
              testCheckBoxes.add( new TestCheckBox() );
      }
  
      public List getTestCheckBoxes() {
          return testCheckBoxes;
      }
      public void setTestCheckBoxes(List testCheckBoxes) {
          this.testCheckBoxes = testCheckBoxes;
      }
  }