aspose file tools*
The moose likes Struts and the fly likes How to send value recently selected in the url as a param? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to send value recently selected in the url as a param?" Watch "How to send value recently selected in the url as a param?" New topic
Author

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

Romina Milano
Greenhorn

Joined: Aug 01, 2011
Posts: 1
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!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Welcome to the Ranch.

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: How to send value recently selected in the url as a param?