Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Multiple AJAX submit buttons in STRUTS 2

Multiple AJAX submit buttons in STRUTS 2

2007-11-07       - By Jeromy Evans

 Back
Reply:     1     2     3     4     5  

ahh, sorry, you're right Steve. I just searched through all my code and
I've used href="actionUrl" for every ajax submit button that isn't using
the form's default action.

I've only used action="actionAlias" for non-ajax submit buttons.

I think the work-around you've found is the way forward.

kingysball wrote:
> Thanks for your repsonse, I've double checked and I have included the <s:head
> theme="ajax"> tag.   Including a default Action in the form is probably a
> good idea, but doesn't seem to be impacting my AJAX buttons.
>
> I'm still not getting the previous code to work, I have a work around using
> the href attribute as below -
>
>  <html>
>  <s:div id="persons"  theme="ajax" href="%{descrsUrl}" />
>  <s:form id="form1@  >    
>     <s:textfield id="firstName" label="test" name="test"/>
>     <s:submit theme="ajax" targets="persons" href="%{actionA}"  formId="form1"
> />
>     <s:submit theme="ajax" targets="persons"  href="%{actionB}"
> formId="form1"  />
>  </s:form>
>  </html>
>
> Should the Action parameter be working in an AJAX button or is this
> workaround the way forward?
>
> Thanks,
>
> Steve
>
>
>
> Jeromy Evans - Blue Sky Minds wrote:
>  
>> Yes it possible and your attempt at specifying a different action for
>> each submit button is correct.
>>
>> However:
>> Did you include <s:head theme="ajax">?  If not, it's just doing a normal
>> submit, not XHR and that may explain the problem.
>> I think you should give your form a default action even though you won't
>> use it.
>> The two submit tags are correct
>> Don't forget to use s:url to define the URL for your div
>> Finally, use Firebug or Fiddler to see what each post actually contains.
>>
>> Hope that helps,
>> Jeromy Evans
>>
>> kingysball wrote:
>>    
>>> As part of my STRUTS 2 application i'm trying to use the AJAX theme to
>>> give
>>> me 2 submit buttons within a Form that I can use to submit data to either
>>> different Actions or different Methods in the same Action.  Initially i
>>> tried the following -
>>>
>>> <html>
>>> <s:div id="persons"  theme="ajax" href="%{descrsUrl}" />
>>> <s:form  >    
>>>   <s:textfield id="firstName" label="test" name="test"/>
>>>   <s:submit theme="ajax" targets="persons" action="test" />
>>>   <s:submit theme="ajax" targets="persons"  action="simpleAJAX"  />
>>> </s:form>
>>> </html>
>>>
>>> but this code only ever submits to the same Action.  Is this posisble??
>>> Can
>>> I use the AJAX theme to submit data to different functions from within
>>> the
>>> same Form???
>>>
>>> Any help much appreciated.
>>>  
>>>      
>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>>    
>
>  


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.