aspose file tools*
The moose likes JSF and the fly likes populating listbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "populating listbox" Watch "populating listbox" New topic
Author

populating listbox

Vibhas Kumar
Greenhorn

Joined: Oct 13, 2009
Posts: 28
Hi friends i have problem related to Listbox in jsf . I have a class say AcessCategoryBB which is in session ,a listbox is displaying the data in my jsp page after fetching the value from list using listbox. The listbox fetch the data from database and those data is only being shown in the listbox. Now my problem is i have the option of enetering the data from the jsp page and that data is actually inserted in the same database table from where the listbox popoualtes its data through list. Now if i insert a new data and wants to display it after it is being inserted i m unable to do it but if i re-enter that page after logout i get the data which i have inserted last. So how can i show the inserted data in the same listbox without being logout. The restriction is i have to keep the BackingBean in seesion scope if its in request then after refreshing i got the value but i have 2 keep it in session. Please help...
rajesh bendalam
Greenhorn

Joined: May 06, 2011
Posts: 1
Send your code once to hariprasad.bendalam@gmail.com, then i will send the solution for that
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

Send your code once to hariprasad.bendalam@gmail.com, then i will send the solution for that


The whole point of this forum is to learn and not give solutions... the point is to help people who ask questions and to people having simillar kind of questions, in and using this javaranch forum. Please refrain from posting your personal email id's.. use the private message and email facility provided instead...


Keep learning


Time is what we want the most, but what we use the worst. -- William Penn
Dieter Quickfend
Bartender

Joined: Aug 06, 2010
Posts: 542
    
    4

well, you're not getting the new data because your list is not being refreshed after you submit your new record. That is a good thing, because it means you're not continually doing round trips to your database after every submit.

The problem of your data not showing up instantly is easily solved. At the point that you insert your new record into the database, you also insert that record into your list, which is probably in that same backing bean, no? So you basically go:


instead of just persisting.
The alternative option is refreshing your list from the database (which i find the lesser, because it hampers performance and load), like so:


This is all very dependent on how your code is implemented of course, but that's the gist of it.


Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
 
wood burning stoves
 
subject: populating listbox