]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 6 Aug 2016 08:15:05 +0000 (10:15 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 6 Aug 2016 20:06:30 +0000 (22:06 +0200)
- Well, ui:fragment is according to my trainer not right. What I want here is a navigation to edit/delete/lock/unlock pages depending on the user's account status.
- If the account status is UNCONFIRMED, currently only show edit and delete
- If it is CONFIRMED, add a link to "lock" page.
- If it is LOCKED, add a link to "unlock" page.
- Currently I do this with ui:fragment because it seems to be the only JSF tag that is NOT rendering it's body when the rendered attribute resolves to false.
- If you can find a drop-in replacement, please notify me at roland[AT]mxchange[DOT]org
- And please keep in mind that c:if or anything like that is JSP which is being executed on an other life-cycle step than JSFs.

web/WEB-INF/templates/admin/user/admin_user_links.tpl

index ef30a7698a6d0bc6b01d4f1e8edf6ffaa909d51d..34cb19a5c3bf7d753a59a48cc1c589e72db30e45 100644 (file)
                                                </h:link>
                                        </li>
 
-                                       <li>
-                                               <h:link outcome="admin_unlock_user" value="#{msg.ADMIN_LINK_UNLOCK_USER}" title="#{msg.ADMIN_LINK_UNLOCK_USER_TITLE}" rendered="#{beanHelper.user.userAccountStatus == 'LOCKED'}">
-                                                       <f:param name="userId" value="#{beanHelper.user.userId}" />
-                                               </h:link>
+                                       <ui:fragment rendered="#{beanHelper.user.userAccountStatus != 'UNCONFIRMED'}">
+                                               <li>
+                                                       <h:link outcome="admin_unlock_user" value="#{msg.ADMIN_LINK_UNLOCK_USER}" title="#{msg.ADMIN_LINK_UNLOCK_USER_TITLE}" rendered="#{beanHelper.user.userAccountStatus == 'LOCKED'}">
+                                                               <f:param name="userId" value="#{beanHelper.user.userId}" />
+                                                       </h:link>
 
-                                               <h:link outcome="admin_lock_user" value="#{msg.ADMIN_LINK_LOCK_USER}" title="#{msg.ADMIN_LINK_LOCK_USER_TITLE}" rendered="#{beanHelper.user.userAccountStatus == 'CONFIRMED'}">
-                                                       <f:param name="userId" value="#{beanHelper.user.userId}" />
-                                               </h:link>
-                                       </li>
+                                                       <h:link outcome="admin_lock_user" value="#{msg.ADMIN_LINK_LOCK_USER}" title="#{msg.ADMIN_LINK_LOCK_USER_TITLE}" rendered="#{beanHelper.user.userAccountStatus == 'CONFIRMED'}">
+                                                               <f:param name="userId" value="#{beanHelper.user.userId}" />
+                                                       </h:link>
+                                               </li>
+                                       </ui:fragment>
 
                                        <li>
                                                <h:link outcome="admin_delete_user" title="#{msg.ADMIN_LINK_DELETE_USER_TITLE}">