myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "MyFacesComponents" by MartinMarinschek
Date Mon, 19 Sep 2005 00:21:56 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by MartinMarinschek:
http://wiki.apache.org/myfaces/MyFacesComponents

------------------------------------------------------------------------------
  Tomahawk offers an extended versions of the standard components, and a number of more advanced
additional components.
  
  == Extended Version of Standard Components ==
+ 
  All standard components have an equivalent version in Tomahawk. These extended versions
feature additional attributes.
  
+ Extended features:
- === User-role Awareness ===
- The extended versions all support user-role-awareness: they have an extra attribute {{{enabledOnUserRole}}}
and {{{visibleOnUserRole}}}. The values for these attributes are supposed to be comma separated
lists of user roles. If the current user has a role that is in this list, the component is
rendered '''enabled''', resp. '''visible''' (a better name for the latter attribute might
have been ''{{{renderedOnUserRole}}}'').
  
+  *["User-role Awareness"] Render the component visible and/or enabled based on the user-roles
of the current user.
+  *["DisplayValueOnly"] Toggle between output/input mode
+  *["forceId"] Do not let JSF generate an assembled id of the ids of the component and its
parents, instead use the provided id.
- ==== User Roles ====
- User roles are a [http://java.sun.com/products/jaas/ JAAS] concept. The actual check happens
in the components by a call like
- {{{
-   if (facesContext.getExternalContext().isUserInRole(''role'')) {
-     ...
-   }
-   else {
-     ...
-   }
- }}}
- 
- For more information on user roles, see [http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/faces/context/ExternalContext.html#isUserInRole(java.lang.String)
the JSF API documentation].
- 
- ==== visibleOnUserRole ====
- If the current user has one of the roles listed in the attribute {{{visibleOnUserRole}}},
the {{{rendered}}} attribute is used to decide whether or not to process the component. If
the current user does not have one of the roles listed in the attribute {{{visibleOnUserRole}}},
the the component is not processed (as if {{{rendered="false"}}} on a standard component).
- 
- Since the influence of the attribute {{{visibleOnUserRole}}} is actually implemented via
the standard {{{rendered}}} attribute, users should be aware that when the current user does
not have one of the roles listed in the attribute {{{visibleOnUserRole}}}, the component is
not processed ''in any phase''. Although the name refers to visibility, the attribute does
influence more than merely the ''rendering''.
- 
- 
- ==== enabledOnUserRole ====
- If the current user has one of the roles listed in the attribute {{{enabledOnUserRole}}},
the {{{disabled}}} attribute is used to decide whether or not to render the component ''enabled''.
If the current user does not have one of the roles listed in the attribute {{{enabledOnUserRole}}},
the the component is rendered ''disabled''.
- 
- Note the reversal of logic from the standard {{{disabled}}} attribute to the extended ''
'''not''' disabled on user role'' {{{enabledOnUserRole}}} attribute.
  
  
  === Display Value Only ===

Mime
View raw message