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 17:48:28 UTC

cvs commit: incubator-myfaces/webapps/examples/web tabbedPane.jsp

svieujot    2005/02/08 08:48:28

  Modified:    webapps/examples/web/WEB-INF examples-config.xml
               webapps/examples/web tabbedPane.jsp
  Added:       webapps/examples/src/org/apache/myfaces/examples/misc
                        TestRadioButton.java TestCheckBox.java
  Log:
  Add check box & radio button to the tabbedPane page.
  
  Revision  Changes    Path
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/TestRadioButton.java
  
  Index: TestRadioButton.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;
  
  /**
   * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
   * @version $Revision: 1.1 $ $Date: 2005/02/08 16:48:28 $
   */
  public class TestRadioButton
  {
      private String choice;
  
      public String getChoice() {
          return choice;
      }
      public void setChoice(String choice) {
          this.choice = choice;
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/TestCheckBox.java
  
  Index: TestCheckBox.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;
  
  /**
   * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
   * @version $Revision: 1.1 $ $Date: 2005/02/08 16:48:28 $
   */
  public class TestCheckBox
  {
      private boolean checked;
  
   
      public boolean isChecked() {
          return checked;
      }
      public void setChecked(boolean checked) {
          this.checked = checked;
      }
  }
  
  
  
  1.44      +11 -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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- examples-config.xml	13 Jan 2005 09:24:53 -0000	1.43
  +++ examples-config.xml	8 Feb 2005 16:48:28 -0000	1.44
  @@ -199,7 +199,18 @@
           <managed-bean-class>org.apache.myfaces.examples.misc.TabbedPaneBean</managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
       </managed-bean>
  +    
  +    <managed-bean>
  +        <managed-bean-name>testCheckBox</managed-bean-name>
  +        <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>testRadioButton</managed-bean-name>
  +        <managed-bean-class>org.apache.myfaces.examples.misc.TestRadioButton</managed-bean-class>
  +        <managed-bean-scope>request</managed-bean-scope>
  +    </managed-bean>
   
       <!-- Managed Beans for panelstack example -->
   
  
  
  
  1.23      +10 -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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- tabbedPane.jsp	24 Jan 2005 12:20:11 -0000	1.22
  +++ tabbedPane.jsp	8 Feb 2005 16:48:28 -0000	1.23
  @@ -73,6 +73,8 @@
   
   
                       <x:panelTab id="tab1" label="#{example_messages['tabbed_tab1']}" rendered="#{tabbedPaneBean.tab1Visible}">
  +   	                    <h:selectBooleanCheckbox id="testCheckBox" value="#{testCheckBox.checked}"/><h:outputLabel for="testCheckBox" value="A checkbox"/>
  +	                    <f:verbatim><br/><br/></f:verbatim>
                           <h:inputText id="inp1"/><f:verbatim><br></f:verbatim>
                           <h:inputText id="inp2" required="true" /><h:message for="inp2" showSummary="false" showDetail="true" />
                       </x:panelTab>
  @@ -82,9 +84,14 @@
                       </f:subview>
   
                       <x:panelTab id="tab3" label="#{example_messages['tabbed_tab3']}" rendered="#{tabbedPaneBean.tab3Visible}">
  -                        <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:selectOneRadio value="#{testRadioButton.choice}">
  +							<f:selectItem itemValue="0" itemLabel="First Choice" />
  +							<f:selectItem itemValue="1" itemLabel="Second Choice" />
  +                        </x:selectOneRadio>
  +	                    <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>