Hi,
The 2 things I would check out first.
1) Is the name of the submit button visible as a parameter in the Ajax
request? If not, Stripes will invoke the default handler of your class instead
of the handler you want. Many javascript libraries don’t add parameters that
are buttons when transforming the form into URL parameters.
2) Does the validation fail in your action bean? If validation fails, then
your handler will not be invoked and your javascript code may seem to do
nothing.
De : Pankaj Sikka [mailto:im.pankajsi...@gmail.com]
Envoyé : July-03-14 12:57 PM
À : stripes-users@lists.sourceforge.net
Objet : [Stripes-users] how to submit a stripes form via Javascript
Hi,
I am new to working with Stripes. I have a dropdown ("show ## recordrs per
page") and a paginated table on the JSP page and I want to display as many
records per page in this table, as the value selected in the dropdown.
The action bean has a variable "recordsPerPage" and I am not able to figure out
a way to set the value of this variable and reload the table, so as to change
the number of records that are displayed per page.
What I did is, I added a <stripes:hidden/> with the name "recordsPerPage" and
set the value to be the number of records I want to display. I also added a
<stripes:submit> to the same form. The "name" attribute of this submit button
is the method name of the action bean I have to call. When I click on this
button, I am able to do what I want. But now, I am unable to do it through
javascript. I tried doing Dom.get('changeVarRecordsPerPage').submit(); but
that does not fire. I am using YUI.
Basically, what I want is to be able to submit the stripes form on the dropdown
selection,without having to add that <stripes:submit>. Please help.
Thanks.
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users