• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Altering StrutsUtils.addEventListener behavior in utils.js /Customizing the framework

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like some way to fine tune the utils.js behavior. I am using 3 optiontransferselect boxes on a page. utils.js generates this code automatically in the page to select all the items in both select boxes when the form is submitted.



I dont need the values in the right hand multiselect list box submitted so I dont need them all selected. So ideally what I would like to do is somehow alter the framework so if it sees option select transfer object this is printed out as the javascript in the page



I know I can remove the lefthand option transfer events by altering Template/simple/form-close.ftl at the top but thats actually the portion I want to retain & can use to change the left hand js function called. I would like to remove the Right hand portion of the selectAllOptionsExceptSome

Is this where I should be concenrating my efforts. Ive never worked with ftl files except for basic css. Even if I comment out all of the optiontransferselect at the top of form-close.ftl struts still generates submit events for exactly the portion I dont want to deal with. The page renders with this javascript:


 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was on the right track with influencing the behavior StrutsUtils.addEventListener but did not look far enough down in the simple/form-close.ftl. If you dont want the option values on the right to be selected on submit you can comment out the following code that starts on line 64



Thanks
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic