[jboss-cvs] jboss-seam/examples/registration/view ...

Gavin King gavin.king at jboss.com
Wed Sep 27 19:15:03 EDT 2006


  User: gavin   
  Date: 06/09/27 19:15:03

  Modified:    examples/registration/view    editContact.xhtml search.xhtml
                        viewContact.xhtml
  Log:
  latest improvements to crud example
  
  Revision  Changes    Path
  1.2       +56 -48    jboss-seam/examples/registration/view/editContact.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: editContact.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/registration/view/editContact.xhtml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- editContact.xhtml	27 Sep 2006 04:11:03 -0000	1.1
  +++ editContact.xhtml	27 Sep 2006 23:15:03 -0000	1.2
  @@ -15,6 +15,9 @@
       
       <h:messages/>
       
  +	  <!-- editable fields --> 
  +      <s:validateAll>
  +      
       <table>
         <tr>
           <td>First Name</td>
  @@ -54,15 +57,20 @@
         </tr>
       </table>
       
  -    <h:commandLink action="/viewContact.xhtml" value="Update Contact" rendered="#{contactActions.managed}">
  +      </s:validateAll>
  +    
  +      <!-- actions -->
  +      <h:commandLink action="#{contactActions.update}" value="Update Contact" rendered="#{contactActions.managed}">
         <f:param name="contactId" value="#{contact.id}"/>
       </h:commandLink>
  +      <h:outputText rendered="#{contactActions.managed}" value="&#160;&#160;"/>
  +      <h:commandLink action="#{contactActions.remove}" value="Delete Contact" rendered="#{contactActions.managed}">
  +        <f:param name="contactId" value="#{contact.id}"/>
  +      </h:commandLink>
  +      <h:commandLink action="#{contactActions.persist}" value="Create Contact" rendered="#{!contactActions.managed}"/>
       &#160;&#160;
  -    <h:commandLink action="#{contactActions.persist}" value="Create New Contact" rendered="#{!contactActions.managed}"/>
  -    &#160;&#160;
  -    <h:commandLink action="#{contactActions.remove}" value="Delete Contact" rendered="#{contactActions.managed}"/>
  -    &#160;&#160;
  -    <s:link view="/viewContact.xhtml" value="Cancel"/>
  +      <s:link view="/viewContact.xhtml" value="Cancel" rendered="#{contactActions.managed}"/>
  +      <s:link view="/search.xhtml" value="Cancel" rendered="#{!contactActions.managed}"/>
       
       </h:form>
      
  
  
  
  1.2       +26 -15    jboss-seam/examples/registration/view/search.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: search.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/registration/view/search.xhtml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- search.xhtml	27 Sep 2006 04:11:03 -0000	1.1
  +++ search.xhtml	27 Sep 2006 23:15:03 -0000	1.2
  @@ -10,10 +10,17 @@
       <title>Contact List</title>
     </head>
     <body>
  +  
  +    <h:messages/>
  +    
  +    <!-- search box -->
       <h:form>
          First Name: <h:inputText value="#{exampleContact.firstName}"/>
          Last Name : <h:inputText value="#{exampleContact.lastName}"/>
          <h:commandButton value="Search" action="/search.xhtml"/>
  +    </h:form>
  +    
  +    <!-- search results -->
       <table>
         <tr>
           <th>Name</th>
  @@ -42,8 +49,9 @@
           </tr>
         </ui:repeat>
       </table>
  -    </h:form>
       
  +    <!-- pagination control -->
  +    <div>
       <s:link view="/search.xhtml" rendered="#{contacts.previousExists}" value="&lt;&lt;">
         <f:param name="firstResult" value="0"/>
       </s:link>
  @@ -58,6 +66,9 @@
         <f:param name="firstResult" value="#{contacts.nextFirstResult}"/>
       </s:link>
       <h:outputText rendered="#{!contacts.nextExists}" value="&gt;"/>
  +    </div>
  +    
  +    <s:link view="/editContact.xhtml" value="Create New Contact"/>
       
     </body>
   </html>
  
  
  
  1.2       +13 -0     jboss-seam/examples/registration/view/viewContact.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: viewContact.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/registration/view/viewContact.xhtml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- viewContact.xhtml	27 Sep 2006 04:11:03 -0000	1.1
  +++ viewContact.xhtml	27 Sep 2006 23:15:03 -0000	1.2
  @@ -11,6 +11,9 @@
     </head>
     <body>
     
  +    <h:messages/>
  +  
  +    <!-- fields -->
       <table>
         <tr>
           <td>First Name</td>
  @@ -50,8 +53,18 @@
         </tr>
       </table>
       
  +    <!-- links and actions -->
       <s:link view="/editContact.xhtml" value="Edit Contact"/>
       &#160;&#160;
  +    <s:link action="#{contactActions.remove}" value="Delete Contact" rendered="#{contactActions.managed}">
  +      <f:param name="contactId" value="#{contact.id}"/>
  +    </s:link>
  +    &#160;&#160;
  +    <s:link view="/editContact.xhtml" value="Create New Contact">
  +      <f:param name="contactId"/> <!-- suppress propagation of contact id page parameter -->
  +    </s:link>
  +    &#160;&#160;
       <s:link view="/search.xhtml" value="Search Contacts"/>
  +    
     </body>
   </html>
  
  
  



More information about the jboss-cvs-commits mailing list