• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to send value recently selected in the url as a param?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello! I'm working on a struts2 (2.2.3) web app, using jquery plugin (3.0.0) for ajax.

I have a jsp in which I have one s:select and one sj:autocompleter (the first one for providers and the second one for products). I need to filter the products by the provider selected. In this particular application is a must to have an autocompleter for the second collection.

What I want is to send in the url the value selected in the first select as a parameter so that I'm able to use that selection for filtering the second autocompleter.

Part of my jsp code:



The problem I'm having is that "%{purchase.provider.id}" is something selected exactly before sending the url_products and when I send the value through the url the value is not updated from the latest selection done.
What I think is that this value is part of the session and since the new selection done for the provider has not been submitted yet to the action, "%{purchase.provider.id}" is just pointing to the value the session is aware of.

I also tried adding the "formIds" property to the autocompleter but it did not solve the issue.

Question: How can I send the value recently selected in "purchaseProviderId" autocompleter through the url as a param? Could I use javascript?

Thanks in advance!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
Destroy anything that stands in your way. Except this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic