• 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

Run the MethodeBean & display the fields that corresponds to selectMenu

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use rendered attribute of tag to display or hide.
 
Yas El
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can Someone help me please
 
Ranch Hand
Posts: 54
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.









 
Good night. Drive safely. Here's a tiny ad for the road:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic