wood burning stoves 2.0*
The moose likes JSF and the fly likes Run the MethodeBean & display the fields that corresponds to selectMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Run the MethodeBean & display the fields that corresponds to selectMenu" Watch "Run the MethodeBean & display the fields that corresponds to selectMenu" New topic
Author

Run the MethodeBean & display the fields that corresponds to selectMenu

Yas El
Greenhorn

Joined: Dec 29, 2011
Posts: 11
Hello,

I have a page. Xhtml, which contains a list of choices (Oracle, Teradata), I want :

1 - If the user chooses Oracle will display the fields (host, port, user, password, basename) will fill it, and calls the method connect in class ManagedBeanO.

2 - If the user selects Teradata, there will be just the fields (host, user, password) to complete, and calls the method connect in class ManagedBeanT to connect.

Choix.xhtml
Bajrang Asthana
Ranch Hand

Joined: May 24, 2011
Posts: 32
You can use rendered attribute of tag to display or hide.
Yas El
Greenhorn

Joined: Dec 29, 2011
Posts: 11
Hi bajrang asthana

How can I use use rendered attribute of tag to display or hide ???

Can you help me, or edit my code please ... because I'm beginner in this stuff

Bajrang Asthana
Ranch Hand

Joined: May 24, 2011
Posts: 32
You can do like below-

1. Add value change listener with your h:selectOneMenu


Specify ManagedBeanMethod and store selected item of menu bar.

2. Specify rendered attribute like below




when you want to show this tags you need to return true value from ManagedBeanMethod like below-



Yas El
Greenhorn

Joined: Dec 29, 2011
Posts: 11
I edit my choix.xhtml


Where can I put this ? :


And the ManagedBeanMethod : will be in ManagedBeanT or ManagedBeanO ?

?? How Can I know is the selecteItem is Oracle or Teradata ?


Yas El
Greenhorn

Joined: Dec 29, 2011
Posts: 11
Can Someone help me please
Louis Bros
Ranch Hand

Joined: Jun 03, 2011
Posts: 54

Hi,

You can use the 'rendered' attribute to either render or not render an element depending on a condition.

You could use a ManagedBean to represent the user's choice.










OCA7
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Run the MethodeBean & display the fields that corresponds to selectMenu