Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Conditional output of text box or label via custom JSF component?

843844Jul 20 2007 — edited Jul 23 2007
Hi

I'm looking to output a text box or a label on a web page depending on a user's ability to modify data.

For example, my initial thought is that if a user is considered read-only within a system, I want to evaluate this within a custom JSF component and output a label containing data. If the user has "write" access, I want to output an input text box to enable the user to modify the same data.

Is this possible? So far, I've tried dynamically modifying the component type but with no great success. I was just looking at doing the same thing with the renderer type as well.

P.S. I can do this using conditional statements within JSP but I'd like to encapsulate these conditions within a custom tag to reduce the need to write lots of if...else statements in the page.

Any help much appreciated...thanks

Message was edited by:
dfz
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2007
Added on Jul 20 2007
9 comments
611 views