File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Dynamic Forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Dynamic Forms" Watch "Dynamic Forms" New topic
Author

Dynamic Forms

Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
Hi there,

I have a Backing Bean for my Edit User page. The Edit User page allows an admin to edit the user details.

Now, I want to create a View User page which is exactly similar to the Edit User page except that it doesnt allow you to edit the details (read only)

I dont want to make two seperate pages for this. How can I achieve this using my backing bean?


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Well, you can simply disable all the controls, but that usually looks pretty ugly. Plus when everything's framed in a control object, users are apt to get confused when they see an "editable" form with nothing editable on it.

I've always (dating all the way back to when JSPs first came out) maintained 2 separate JSPs for this kind of stuff. It may seem like duplication, but it gives a lot more control over the appearance. Usually my display and edit views don't look that much alike anyway.


Customer surveys are for companies who didn't pay proper attention to begin with.
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
It may seem like duplication

thats exactly what i am trying to avoid
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You can go for disabling the fields. But then you need to beautify the stuff. And, surely, need to handle those confusions which might occur when user see the same with disabled field. We can spiffy that using CSS.

Cheers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic Forms
 
Similar Threads
JSF Beginner
how to display multiple lines
Pass data between managed/ backing beans
How to call JSF backing bean method from the Applet
Bean confusion!