|
See if this helps http://punterpandey.blogspot.com/2006/09/fattribute-tag-in-jsf.html Vivek Pandey | SCA Technologies LLC, Gurgaon | 91-9818872105
From: Matta, Keerthi
[mailto:[EMAIL PROTECTED] Small correction in Java code: Hi, I have a requirement around component level security,
depending on the user role a particular component in the page should be
displayed. I am trying to achieve this functionality by identifying the
component which is having a specific attribute called
“needProtection”. I am trying to retrieve this information about the
component in the PhaseListener, and depending on the role I am trying to update
rendered property of the component to “true” or “false”. I am setting a component as follows in the JSP page: <h:commandButton value=”submit”
style="width:95px" action=""> <f:attribute name=" needProtection" value="AOP"/></h:commandButton> I am calling the following method to get attribute
information: if (component.getAttributes().containsKey("needProtection
")) {
String fieldRefValue = component.getAttributes().get("needProtection
").toString();
if(fieldRefValue.equals("AOP")) {
component.setRendered(false);
}
} The problem I am currently facing is, I am not able to
retrieve the attribute information set in the JSP page in the PhaseListener. A snippet of code which is able to retrieve attribute
information would be helpful very much. Thanks in advance, Keerthi From: Matta, Keerthi
[mailto:[EMAIL PROTECTED] Hi, I have a requirement around component level security,
depending on the user role a particular component in the page should be
displayed. I am trying to achieve this functionality by identifying
the component which is having a specific attribute called
“needProtection”. I am trying to retrieve this information about the
component in the PhaseListener, and depending on the role I am trying to update
rendered property of the component to “true” or
“false”. I am setting a component as follows in the JSP page: <h:commandButton value=”submit”
style="width:95px" action=""> <f:attribute name=" needProtection" value="AOP"/></h:commandButton> I am calling the following method to get attribute
information: if (component.getAttributes().containsKey("needProtection
")) {
String fieldRefValue = component.getAttributes().get("needProtection
").toString();
if(needProtection.equals("AOP")) {
component.setRendered(false);
}
} The problem I am currently facing is, I am not able to
retrieve the attribute information set in the JSP page in the PhaseListener. A snippet of code which is able to retrieve attribute
information would be helpful very much. Thanks in advance, Keerthi
|
- RE: How to access f:attribute Matta, Keerthi
- RE: How to access f:attribute Vivek Pandey

