Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic Forms

 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18157
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may seem like duplication

thats exactly what i am trying to avoid
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic