• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

JSF and JQuery - error with selectOneListBox  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my application I have two list boxes (selectOneListBox) one representing available values (pre populated) and one representing selected values (empty). Both list boxes are have the f:selectItems tag which is bound to a variable in the backing bean. When I choose a value from the Available list and click on the "add" button, I use JQuery to transfer the selected item from the Available list to the Selected List. All this works fine.

However when I click on the save button (h:commandButton) my application goes through the various life cycle phases and when it reaches the process validation phase, it performs a SelectItemsIterator on both Lists but fails on the Selected List with the error "NoSuchElementException()" since it was initially empty. I initialized the List Boxes as follows.




I have tried initializing the Map to have an empty key and value pair, but when I run the application,
the list item contains an empty entry, and that is also allowed to be moved between lists when I add to or remove from the Selected List.

I would like to know if there is a way to bypass the list validation.

All I require is that After I transfer the Items from Available List to Selected List and hit submit, I need to be able to access the List items in the backing bean. If you have a work around to my problem stated above or if you have a completely different approach in handling this problem I would be really happy to hear from you. thanks for your replies in advance.

Regards,
Amar Mahtani
 
Marshal
Posts: 67197
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this for information on why using phrases like "urgent" can cause your post to be ignored. I have removed it from your subject for you.
 
amar mahtani
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear for the suggestion.
 
You showed up just in time for the waffles! And this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!