• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic