How to dynamically generate content of Drop Down List
-
- Posts: 280
- Joined: 25 Jun 2010, 01:18
I am very new to JSF and PrimeFace. So please forgive my ignorance if the answer to the question is too obvious. I have couple Drop down list on my page. The contents of the drop down list are populated when the page is loaded. As I select the item in that first drop down list, content of the second drop down list get populated. How can I do that with JSF + PrimeFace. Sample code would be greatly appreciated
Hi,
There's an example in the PrimeFaces showcase that would be a good start. I can't link you to the online demo at the moment because the demo server appears to be down and I don't have the required URL in my head!
You can download the entire showcase from the download page http://www.primefaces.org/downloads.html
The xhtml file to look at is pprSelect.xhtml
The corrseponding bean is in PPRBean.java
pprSelect.xhtml has two <h:selectOneMenu> tags called "city" and "suburbs" that do what you want to do.
There's an example in the PrimeFaces showcase that would be a good start. I can't link you to the online demo at the moment because the demo server appears to be down and I don't have the required URL in my head!
You can download the entire showcase from the download page http://www.primefaces.org/downloads.html
The xhtml file to look at is pprSelect.xhtml
The corrseponding bean is in PPRBean.java
pprSelect.xhtml has two <h:selectOneMenu> tags called "city" and "suburbs" that do what you want to do.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
-
- Posts: 280
- Joined: 25 Jun 2010, 01:18
Thank you so much. I will take a look at it.
Mojarra 2.1.10, Glassfish 3.1, Tomcat 7, Primeface 3.3.1
IE 6-8, FireFox 10-13
MAC OSX Lion, Windows XP, 7
-
- Posts: 13
- Joined: 05 Jul 2010, 22:15
Any hints on how to style these a little better?
-
- Posts: 13
- Joined: 05 Jul 2010, 22:15
Actually never mind about that. I got busy with the CSS and prettified it.
I do wonder about styling these sorts of components (jsf/html) in general. For example the datatable's row cardinality selector. It looks a little naff compared to the other controls.
I do wonder about styling these sorts of components (jsf/html) in general. For example the datatable's row cardinality selector. It looks a little naff compared to the other controls.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests