• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Render different controls

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I have one form for create and edit since the controls on the page are more or less same (one difference).

There is a drop down box to choose a company name when one comes from the create navigation.

If one comes from the edit navigation the user is not allowed to change the company name, so it is a output label with the company name previously selected (during the create page).

Can someone help me as to how do i render the control on the basis of the the action that being -create or edit.

I do not want to make two forms.

Regards,
Shruti
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alot of ways to accomplish what you requires. Commonly, you just need some place to store the action user currently doing.

Managed Bean Facility would be a good place for this. You can define a managed bean that contains the flag that indicates the activity user currently engaging in.

Then, using the value from the bean you can customize the presentation of your JSF components. For example, almost all JSF HTML component got a rendered attribute that you can set. There is also
readonly and disabled attribute for input components.
 
reply
    Bookmark Topic Watch Topic
  • New Topic