File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Render different controls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Render different controls " Watch "Render different controls " New topic

Render different controls

Shruti B

Joined: Jan 19, 2006
Posts: 7
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,<br />Shruti
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
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.

SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Render different controls
It's not a secret anymore!