• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Stripes not getting value from form field

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am at a loss. I am trying to do a simple ajax post to an action bean using jquery. I have followed Freddie's book example using partial forms because I have to insert a select tag inside an existing form. I couldn't get that to work so I looked at several online examples. I had another developer look at my code who has Ajax experience and he said it looked fine. But it's not fine.

In my eclipse debugger, I can see in context.request.parameterMap that my data is there in the correct object:

contractTerms.executionMonth=[G2006]

But when I look at the object on the action bean I see this:

BdQBDxuw1FmzhjnwVnB14JwdSNs= this value changes every time I run it.

What is that? Obviously my query fails as there is no such value in my database. I suspect I am missing some simple fundamental element, but I can't see it. Doesn't stripes read the values from the parameterMap? If not, where does it read from? Is JQuery doing this to my object? How do I correct it?

my Ajax looks like this:

function findStrikePrices(field) {
var form = field.form;
var params = $(form).serialize() + '&_eventName=' + 'findStrikePrices';
$.post(form.action, params,
function(data) {
$('#priceList' ).html(data);
}
);
return false;
}


The select tag in my jsp looks like this:

<s:select name="contractTerms.executionMonth" id="executionMonth">
<s:option selected="true" value="">
<fmt:message key="monthList.selectAMonth"/>...
</s:option>
<c:forEach items="${actionBean.executionMonths}" var="month">
<s:option value="${month}">${month}</s:option>
</c:forEach>
</s:select>


The variable on my action bean is defined like this:

private ContractTerms contractTerms = new ContractTerms();

executionMonths is defined in ContractTerms:

private String executionMonth;

I have spent a lot of time debugging, rewriting, and running with both JQuery and Prototype and I just don't understand why this is failing. Any help would be greatly appreciated. I will be happy to send additional code if needed. I am not having fun at this point. I thought Stripes was going to make Java fun again? ;-)
 
this is supposed to be a surprise, but it smells like a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic