Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Render different controls

 
Shruti B
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic