aspose file tools*
The moose likes JSF and the fly likes Move option between two selectManyListbox using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Move option between two selectManyListbox using javascript" Watch "Move option between two selectManyListbox using javascript" New topic
Author

Move option between two selectManyListbox using javascript

earist neko
Greenhorn

Joined: Jan 13, 2011
Posts: 2
I have two selectManyListbox moving options from Left to Right / Right to Left which i am doing in Javascript and it is working fine.

But when i click submit button error is occured.

error:




JSP Page (Role editor page):




Javascript code :




Bean:






I don't wnat to change my backing bean to session scope.
My jsp page show all rolebean object in containment tree. When click the role, Two SelectManyListbox will be shown on Role editor page.
Listbox on left show all roles that the clicked role can use (call getItemLeft ()) and Listbox on right show all used roles of the clicked role (call getItemRight()).
Options can be moved between two listboxes. When Role editor page is refreshed (by click role in containment tree, refresh page etc.) , the options in listboxes are reverted and call getItemLeft ()/getItemRight () again.

Any idea?
Thank in advance and sorry for my bad english.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

JSF tends to force you to use session scope in places where you otherwise could get away without it because of its extensive use of postbacks. The problem is so bad, in fact, that JSF2 added the View scope in order to provide a shorter-term storage alternative.

However, the type of UI you are describing is already available pre-debugged and ready to use as a single component in some of the advanced JSF extension tagsets such as RichFaces.


Customer surveys are for companies who didn't pay proper attention to begin with.
earist neko
Greenhorn

Joined: Jan 13, 2011
Posts: 2
Now, i'm using ICEfaces 1.8.0
I want to implement UI look like duallist of ICEFaces or picklist of RichFaces.
But i want some items are directly added to both left and right list when page loaded.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

earist neko wrote:Now, i'm using ICEfaces 1.8.0
I want to implement UI look like duallist of ICEFaces or picklist of RichFaces.
But i want some items are directly added to both left and right list when page loaded.


That actually doesn't make sense, since you explicitly said you wanted to move stuff, and how do you move it if it's already there?

If the normal shuttle control functionality isn't what you want, you're on your own. But if you want to do that using JavaScript, JSF doesn't really factor into the process. JSF doesn't make much difference other than the fact that the ids for the raw HTML controls are a bit different. Your main problems are going to be JavaScript problems, and we have a forum where the JavaScript experts hang out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Move option between two selectManyListbox using javascript