• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

can anybody help ??

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
This is srinivas
I developed a page with 4 dropdown lists
Now i want to change the behaviour of the dropdown lists
Intially only one dropdown list must appear
when i select any option from the list other dropdown list must appear
The code i used is


please post any suggestions
 
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for this functionality do one thing.

on onselect event submit the form and call one action. that action will set the rendered property true of the next drop down. same for rest two also.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi sudhasrinivas,

I'm not an expert in JSF - so I can only give you some basic advises to your code.

1. you need to submit each time the value in the dropdown changes - use "onchange" attribute in 'h:selectOneMenu' which referrer to a JavaScript function from where you submit.

2. use some kind of boolean 'flag' to control when the other dropdown(s) should be shown - when you submit, you enter your java action bean, here you set a flag, and return to the same web page you came from (I think that the attribute to use in 'h:selectOneMenu' is called 'rendered').
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Rene you are correct. The problem can be solved in this way.
 
It will give me the powers of the gods. Not bad for a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic