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

Gavin King gavin.king at jboss.com
Thu Oct 5 16:42:14 EDT 2006


  User: gavin   
  Date: 06/10/05 16:42:14

  Modified:    examples/contactlist/view   viewContact.xhtml
  Added:       examples/contactlist/view   comment.xhtml
  Log:
  example of association handling
  
  Revision  Changes    Path
  1.2       +16 -0     jboss-seam/examples/contactlist/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/contactlist/view/viewContact.xhtml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- viewContact.xhtml	28 Sep 2006 00:18:33 -0000	1.1
  +++ viewContact.xhtml	5 Oct 2006 20:42:14 -0000	1.2
  @@ -53,7 +53,23 @@
         </tr>
       </table>
       
  +    <!-- associations -->
  +    
  +    <h:dataTable value="#{contact.comments}" var="c" rendered="#{not empty contact.comments}">
  +      <h:column>
  +        <h:outputText value="#{c.created}">
  +          <f:convertDateTime type="both"/>
  +        </h:outputText>
  +      </h:column>
  +      <h:column>
  +        <f:facet name="header">Comment</f:facet>
  +        #{c.text}
  +      </h:column>
  +    </h:dataTable>
  +    
       <!-- links and actions -->
  +    <s:link view="/comment.xhtml" value="Create Comment"/>
  +    &#160;&#160;
       <s:link view="/editContact.xhtml" value="Edit Contact"/>
       &#160;&#160;
       <s:link action="#{contactActions.remove}" value="Delete Contact" rendered="#{contactActions.managed}">
  
  
  
  1.1      date: 2006/10/05 20:42:14;  author: gavin;  state: Exp;jboss-seam/examples/contactlist/view/comment.xhtml
  
  Index: comment.xhtml
  ===================================================================
  <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml"
  	    		xmlns:ui="http://java.sun.com/jsf/facelets"
  	  			xmlns:h="http://java.sun.com/jsf/html"
  	  			xmlns:f="http://java.sun.com/jsf/core"
  	  			xmlns:s="http://jboss.com/products/seam/taglib"
  				template="template.xhtml">
    <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Create Comment</title>
    </head>
    <body>
    
      <h:form>
      
        <h:messages globalOnly="true"/>
  	  
  	  <!-- editable fields --> 
        <s:validateAll>
        
          <table>
            <tr>
              <td>Comment</td>
              <td><h:inputTextarea id="text" value="#{comment.text}" rows="15" cols="100"/></td>
              <td><h:message for="text"/></td>
            </tr>
          </table>
      
        </s:validateAll>
      
        <!-- actions -->
        <h:commandLink action="#{commentActions.persist}" value="Create Comment">
          <f:param name="contactId" value="#{contact.id}"/>
        </h:commandLink>
        &#160;&#160;
        <s:link view="/viewContact.xhtml" value="Cancel"/>
      
      </h:form>
     
    </body>
  </html>
  
  
  



More information about the jboss-cvs-commits mailing list