Hi gang, my first post here, but have searched high and low for an answer to this problem that works... To no avail! I hope someone can tell me to keep trying, or to give up!
I have a form for operating a PC seat booking system that I'm trying to put together using the struts2 ajax functionality.
The form has a s:datetimepicker, and a s:select field (for a seat type), and two buttons. I would like each button to trigger a different action eventually, but can't seem to figure out how to do it.
Here is the code I'm working on at the moment (I have a bean called "detail" instantiated in my action, which gets loaded with seatType and seatDateFromString, and submitValue) :
In this the form is POSTed to a handler method in the action, in which I hoped to look at detail.submitValue to see which button was pressed, and then branch based on that. detail.submitValue always just ends up as null.
I also tried
Which works lovely and goes directly to the right methods in the action that I've set up in some s:url, but it doesn't include the rest of the form data that I actually want posting. If I add formId="detailControlForm" to the s:submit tags, then both submit tags revert to submitting the base action associated with the page, though they do include the form fields.
I also tried
Which does the same: triggers Flexi.action (the base action for this page). If I remove the formId="..." from the submit tags, then the correct actions get triggered, but obviously with no field contents included.
I am sure that at least one of these should work! I don't have any interceptors in the interceptor stack however, so I wonder if that takes care of this
struts magic in a way I don't understand!
Maybe someone can help me, let me know I am barking up the wrong tree entirely perhaps!
Thanks!
SN