The moose likes Struts and the fly likes s:optiontransferselect odd rendering on submit to action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:optiontransferselect odd rendering on submit to action" Watch "s:optiontransferselect odd rendering on submit to action" New topic

s:optiontransferselect odd rendering on submit to action

E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
I am using 3 s:optiontransferselect on one form with struts 2.1.8. There are probable 500 or so select items between the three of them. When the submit button is used to submit the form to the action you can see all of the select boxes being parsed and selected. It looks looks really odd and is very distracting from an end user point of view. Has anyone noticed this behavior?

IMHO it makes s:optiontransferselect unusable. I cant imagine any of my clients would think this behavior is normal. Im wondering if there might be a work around so that when submit is selected it doesnt parse every select box on the page and select every item in every select list?

Here is a sample of one of the select list boxes I am using:

I have attached a screen shot of what it looks like just before the form moves to the action. Since I dont want to attach video you will have to use your imagination to visualize all these option values rolling along and being selected.

Also noticed this behavior occurs when you use the back button after the action has executed.


[Thumbnail for optiontransferselect.jpg]

Jesus Mireles
Ranch Hand

Joined: Mar 10, 2010
Posts: 122

This has to be browser behavior right? There is no way this is server side behavior? Did you try on different browsers to see if it behaves differently?

E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
That was my original thought but after testing in Chrome & Firefox the behavior is the same. Looks really odd to to hit submit and watch all those option values run through being selected.
E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
Well it looks like struts utils select everything on submit so it looks like I need to rewrite the struts utils to get a cleaner method of selecting these. Between rewriting the struts utils, freemarker templates and css I could have probable had the site completed by now. I am really beginning to sour on MVC in favor of RAD deployment.

Added by struts which is why on submit you get to see the browser run through selecting all the options:

Consider Paul's rocket mass heater.
subject: s:optiontransferselect odd rendering on submit to action
Similar Threads
problem with validation and tag s:optiontransferselect in Struts2
Struts 2 Select Tag
Altering StrutsUtils.addEventListener behavior in utils.js /Customizing the framework
How to limit selections with s:optiontransferselect & struts 2.1
<s:optiontransferselect > items not autoselected on submit.