[seam-commits] Seam SVN: r11352 - in branches/community/Seam_2_2/examples/seamspace: src/org/jboss/seam/example/seamspace and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Aug 7 01:36:10 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-08-07 01:36:10 -0400 (Fri, 07 Aug 2009)
New Revision: 11352

Modified:
   branches/community/Seam_2_2/examples/seamspace/resources/WEB-INF/pages.xml
   branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java
   branches/community/Seam_2_2/examples/seamspace/view/profile.xhtml
Log:
fixed exception when clicking friend request link


Modified: branches/community/Seam_2_2/examples/seamspace/resources/WEB-INF/pages.xml
===================================================================
--- branches/community/Seam_2_2/examples/seamspace/resources/WEB-INF/pages.xml	2009-08-06 22:26:48 UTC (rev 11351)
+++ branches/community/Seam_2_2/examples/seamspace/resources/WEB-INF/pages.xml	2009-08-07 05:36:10 UTC (rev 11352)
@@ -95,10 +95,10 @@
       </navigation>
     </page>
     
-    <page view-id="/friendrequest.xhtml">
+    <page view-id="/friendrequest.xhtml">    
       <restrict>#{identity.loggedIn}</restrict>
       <param name="name" value="#{selectedMember.memberName}"/>
-      <navigation from-action="#{friend.saveRequest}">
+      <navigation from-action="#{friendAction.saveRequest}">
         <redirect view-id="/profile.xhtml">
           <param name="name" value="#{friendRequest.member.memberName}"/>
         </redirect>

Modified: branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java
===================================================================
--- branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java	2009-08-06 22:26:48 UTC (rev 11351)
+++ branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java	2009-08-07 05:36:10 UTC (rev 11352)
@@ -73,7 +73,7 @@
       entityManager.persist(friendComment);
    }
    
-   @Factory("friendRequest") @Begin
+   @Begin
    public void createRequest()
    {
       try
@@ -101,6 +101,7 @@
    {
       friendRequest.getMember().getFriends().add(friendRequest);
       entityManager.persist(friendRequest);      
+      FacesMessages.instance().add("Friend request sent");      
    }
    
    @Remove @Destroy

Modified: branches/community/Seam_2_2/examples/seamspace/view/profile.xhtml
===================================================================
--- branches/community/Seam_2_2/examples/seamspace/view/profile.xhtml	2009-08-06 22:26:48 UTC (rev 11351)
+++ branches/community/Seam_2_2/examples/seamspace/view/profile.xhtml	2009-08-07 05:36:10 UTC (rev 11352)
@@ -78,7 +78,7 @@
           <br class="clear"/>
         
           <s:span rendered="#{selectedMember.memberId != authenticatedMember.memberId and s:hasPermission(selectedMember, 'createFriendRequest')}">
-            [<s:link view="/friendrequest.seam" value="Send a friend request" propagation="none"/>]
+            [<s:link view="/friendrequest.seam" action="#{friendAction.createRequest}" value="Send a friend request"><f:param name="name" value="#{selectedMember.memberName}"/></s:link>]
           </s:span>
           
         </s:div>



More information about the seam-commits mailing list