You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by to...@apache.org on 2004/12/18 17:05:37 UTC

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

tomsp       2004/12/18 08:05:37

  Modified:    webapps/examples/src/org/apache/myfaces/examples/listexample
                        SimpleCountryList.java
               webapps/examples/src/org/apache/myfaces/examples/resource
                        example_messages.properties
               webapps/examples/web countryTableForm.jsp jslistener.jsp
  Log:
  no message
  
  Revision  Changes    Path
  1.2       +20 -2     incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SimpleCountryList.java
  
  Index: SimpleCountryList.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SimpleCountryList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleCountryList.java	20 Oct 2004 07:46:39 -0000	1.1
  +++ SimpleCountryList.java	18 Dec 2004 16:05:37 -0000	1.2
  @@ -15,6 +15,10 @@
    */
   package org.apache.myfaces.examples.listexample;
   
  +import org.apache.myfaces.component.html.ext.HtmlDataTable;
  +
  +import javax.faces.event.ActionEvent;
  +import javax.faces.component.UIComponent;
   import java.math.BigDecimal;
   import java.util.ArrayList;
   import java.util.List;
  @@ -110,5 +114,19 @@
       public void setCountries(List countries)
       {
           _countries = countries;
  +    }
  +
  +    public String addCountry()
  +    {
  +        List list = getCountries();
  +        list.add(new SimpleCountry(list.size() + 1, "", "", new BigDecimal(0), new String[] {}));
  +        return "ok";
  +    }
  +
  +    public void deleteCountry(ActionEvent ev)
  +    {
  +        UIComponent comp = ev.getComponent();
  +        HtmlDataTable dataTable = (HtmlDataTable) comp.getParent().getParent();
  +        getCountries().remove(dataTable.getRowIndex());
       }
   }
  
  
  
  1.12      +0 -0      incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/resource/example_messages.properties
  
  Index: example_messages.properties
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/resource/example_messages.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  
  
  
  1.14      +8 -1      incubator-myfaces/webapps/examples/web/countryTableForm.jsp
  
  Index: countryTableForm.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/countryTableForm.jsp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- countryTableForm.jsp	1 Nov 2004 23:04:26 -0000	1.13
  +++ countryTableForm.jsp	18 Dec 2004 16:05:37 -0000	1.14
  @@ -85,12 +85,18 @@
   
                      </h:column>
                      
  -
                      <h:column>
                           <h:selectBooleanCheckbox value="#{country.remove}"/>
                      </h:column>
   
  +                   <h:column>
  +                        <x:commandLink value="#{example_messages['button_delete']}" actionListener="#{countryList.deleteCountry}" />
  +                   </h:column>
  +
                      <f:facet name="footer">
  +                        <h:panelGrid columns="1" >
  +                        <x:commandLink value="#{example_messages['new_country']}" action="#{countryList.addCountry}"   />
  +                        <h:panelGroup><f:verbatim>&nbsp;</f:verbatim></h:panelGroup>
                           <h:panelGroup>
                               <h:commandButton action="go_back" value="#{example_messages['button_save']}" />
                               <f:verbatim>&nbsp;</f:verbatim>
  @@ -98,6 +104,7 @@
                               <f:verbatim>&nbsp;</f:verbatim>
                               <h:commandButton value="#{example_messages['button_apply']}" />
                           </h:panelGroup>
  +                        </h:panelGrid>
                      </f:facet>
   
                   </x:dataTable>
  
  
  
  1.2       +0 -0      incubator-myfaces/webapps/examples/web/jslistener.jsp
  
  Index: jslistener.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/jslistener.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2