Re: [s2] s:submit type=button action=../ broken in IE (was: [S2] Multiple Submits with different actions in a Form)

2007-07-26 Thread Dave Newton
I thought IE's broken button behavior was already
documented, including on the wiki?

d.

--- David Durham, Jr. [EMAIL PROTECTED]
wrote:

   Things like:
  
   s:form action=MyAction.do
   s:submit type=button/
   s:submit type=button action=MyAction!cancel
 value=Cancel/
   /s:form
  
   work for me in firefox, but don't seem to work
 in IE.
 
  Could you provide the rendered HTML that works in
 one browser but not the
  other?
 
 Sure.
 
 TestCancel.jsp
 --
 
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
 Transitional//EN


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 
 %@ taglib prefix=s uri=/struts-tags%
 
 html
 head
 titleCancel Test/title
 /head
 body
 s:form action=TestCancel.do
 s:submit type=button
 action=TestCancel!submit value=Submit/
 s:submit type=button
 action=TestCancel!cancel value=Cancel/
 /s:form
 /body
 /html
 
 struts-config.xml
 --
action name=TestCancel
 class=com.TestCancel
 result name=submit

type=redirect/TestCancel.jsp?cancelled=false/result
 result name=cancel

type=redirect/TestCancel.jsp?cancelled=true/result
/action
 
 com.TestCancel
 
 package com;
 
 public class TestCancel {
 
 public String submit() {
 return submit;
 }
 
 public String cancel() {
 return cancel;
 }
 
 }
 
 
 Removing type=button will fix the IE issue.
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 



  

Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] s:submit type=button action=../ broken in IE (was: [S2] Multiple Submits with different actions in a Form)

2007-07-26 Thread David Durham, Jr.

 Things like:

 s:form action=MyAction.do
 s:submit type=button/
 s:submit type=button action=MyAction!cancel value=Cancel/
 /s:form

 work for me in firefox, but don't seem to work in IE.

Could you provide the rendered HTML that works in one browser but not the
other?


Sure.

TestCancel.jsp
--

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

%@ taglib prefix=s uri=/struts-tags%

html
head
   titleCancel Test/title
/head
body
   s:form action=TestCancel.do
   s:submit type=button action=TestCancel!submit value=Submit/
   s:submit type=button action=TestCancel!cancel value=Cancel/
   /s:form
/body
/html

struts-config.xml
--
  action name=TestCancel class=com.TestCancel
   result name=submit
type=redirect/TestCancel.jsp?cancelled=false/result
   result name=cancel
type=redirect/TestCancel.jsp?cancelled=true/result
  /action

com.TestCancel

package com;

public class TestCancel {

   public String submit() {
   return submit;
   }

   public String cancel() {
   return cancel;
   }

}


Removing type=button will fix the IE issue.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] s:submit type=button action=../ broken in IE (was: [S2] Multiple Submits with different actions in a Form)

2007-07-26 Thread David Durham, Jr.

On 7/26/07, Dave Newton [EMAIL PROTECTED] wrote:

I thought IE's broken button behavior was already
documented, including on the wiki?


That may be.  Here's the rendered HTML:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;



html
head
   titleCancel Test/title
/head
body

form id=TestCancel.do name=TestCancel.do onsubmit=return true;
action=/TestCancel.do method=posttable class=wwFormTable
   tr
   td colspan=2div align=rightbutton type=submit
id=TestCancel.do_TestCancel!submit name=action:TestCancel!submit
value=SubmitSubmit/button
/div/td
/tr

   tr
   td colspan=2div align=rightbutton type=submit
id=TestCancel.do_TestCancel!cancel name=action:TestCancel!cancel
value=CancelCancel/button
/div/td
/tr

   /table/form


/body
/html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] Multiple Submits with different actions in a Form

2007-07-25 Thread Grish

I'm still in the process of learning S2 and I was curious on what's the best
practice in implementing a form with multiple submit buttons

I've read that there are multiple way to implement this. 
One way is here:
http://struts.apache.org/2.0.8/docs/multiple-submit-buttons.html
Although I was thinking I had to redo my setup of my action class and have
all the actions point to one method - execute() and from there i would check
a parameter to determine what my next step would be:

public String execute() {
  if (method.equals(searchMethod)) {
 doSearch();
 return SUCCESS;
  }
  if (method.equals(addMethod)) {
 doAdd();
 return SUCCESS;
  }
   }

something to that effect.

But I also wanted to try having an action class with different methods and
in my struts.xml the different actions would point to the different methods
of my action class.

My problem though is I have a form with multiple submit buttons. I tried
specifying the action on each submit button but the action in my form
overrides the action specified in the buttons. I tried removing the action
parameter in my form but it would take the current action and still override
the actions specified in the buttons. How do I have a form with multiple
submit buttons with different actions? What would be the best practice in
implementing this? Would implementation be any different if my submit
buttons are ajax themed?

Thanks
-- 
View this message in context: 
http://www.nabble.com/-S2--Multiple-Submits-with-different-actions-in-a-Form-tf4140299.html#a11776889
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread David Durham, Jr.

On 7/25/07, Grish [EMAIL PROTECTED] wrote:

My problem though is I have a form with multiple submit buttons. I tried
specifying the action on each submit button but the action in my form
overrides the action specified in the buttons.


I have success with this technique in Firefox, but I think it's broken
in IE.  Is this what you're seeing?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread Grish

no, what happens is the action specified in the form is what's executed. I'm
using firefox as well.

here's my button:

s:submit action=someAction theme=ajax targets=myTarget  /

I tried having the form specify one action and one button have to submit the
form, and another button (like the one above) to have the form submit to
another action. But it seems the action in the form overrides my button.



David Durham, Jr. wrote:
 
 On 7/25/07, Grish [EMAIL PROTECTED] wrote:
 My problem though is I have a form with multiple submit buttons. I tried
 specifying the action on each submit button but the action in my form
 overrides the action specified in the buttons.
 
 I have success with this technique in Firefox, but I think it's broken
 in IE.  Is this what you're seeing?
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Multiple-Submits-with-different-actions-in-a-Form-tf4140299.html#a1178
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread David Durham, Jr.

On 7/25/07, Grish [EMAIL PROTECTED] wrote:


no, what happens is the action specified in the form is what's executed. I'm
using firefox as well.

here's my button:

s:submit action=someAction theme=ajax targets=myTarget  /

I tried having the form specify one action and one button have to submit the
form, and another button (like the one above) to have the form submit to
another action. But it seems the action in the form overrides my button.


Things like:

s:form action=MyAction.do
s:submit type=button/
s:submit type=button action=MyAction!cancel value=Cancel/
/s:form

work for me in firefox, but don't seem to work in IE.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread Joe Germuska

On 7/25/07, David Durham, Jr. [EMAIL PROTECTED] wrote:


 I tried having the form specify one action and one button have to submit
the
 form, and another button (like the one above) to have the form submit to
 another action. But it seems the action in the form overrides my button.

Things like:

s:form action=MyAction.do
s:submit type=button/
s:submit type=button action=MyAction!cancel value=Cancel/
/s:form

work for me in firefox, but don't seem to work in IE.



David:

Could you provide the rendered HTML that works in one browser but not the
other?

--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com

I felt so good I told the leader how to follow.
-- Sly Stone


Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread Grish

Yeah this should work, If i can't find an alternative I most likely will take
this approach. But I was hoping to find a solution that didn't require me to
code a lot of logic using js in the client side. It seems a lot easier if I
can just specifiy the actions with a few controls and the rest is processed
at the server side.


Richard Sayre wrote:
 
 I'm not sure if this is what your are looking for, it is doing the
 control logic on the client side. Instead of using s:submit to submit
 the form you could make 3 input buttons:
 
 input type=button  onClick=doAction1()/
 input type=button  onClick=doAction2()/
 input type=button  onClick=doAction3()/
 
 and the write the following javascript:
 
 function doAction1() {
 
document.getElementById(formId).action = 's:url
 action=myAction1'/;
document.getElementById(formId).submit();
 
 }
 
 function doAction2() {
 
document.getElementById(formId).action = 's:url
 action=myAction2'/;
document.getElementById(formId).submit();
 
 }
 
 function doAction3() {
 
document.getElementById(formId).action = 's:url
 action=myAction3'/;
document.getElementById(formId).submit();
 
 }
 
 then in your struts.xml:
 
 action name=myAction1 class=MyAction method=method1
 .
 .
 .
 /action
 
 
 action name=myAction2 class=MyAction method=method2
 .
 .
 .
 /action
 
 
 action name=myAction3 class=MyAction method=method3
 .
 .
 .
 /action
 
 You don't have to use the Ajax theme on your form, you can write the
 Javascript using the DOJO library your self.  All the nessary files
 are included when you use the s:head tag
 
 On 7/25/07, Grish [EMAIL PROTECTED] wrote:

 I'm still in the process of learning S2 and I was curious on what's the
 best
 practice in implementing a form with multiple submit buttons

 I've read that there are multiple way to implement this.
 One way is here:
 http://struts.apache.org/2.0.8/docs/multiple-submit-buttons.html
 Although I was thinking I had to redo my setup of my action class and
 have
 all the actions point to one method - execute() and from there i would
 check
 a parameter to determine what my next step would be:

 public String execute() {
   if (method.equals(searchMethod)) {
  doSearch();
  return SUCCESS;
   }
   if (method.equals(addMethod)) {
  doAdd();
  return SUCCESS;
   }
}

 something to that effect.

 But I also wanted to try having an action class with different methods
 and
 in my struts.xml the different actions would point to the different
 methods
 of my action class.

 My problem though is I have a form with multiple submit buttons. I tried
 specifying the action on each submit button but the action in my form
 overrides the action specified in the buttons. I tried removing the
 action
 parameter in my form but it would take the current action and still
 override
 the actions specified in the buttons. How do I have a form with multiple
 submit buttons with different actions? What would be the best practice in
 implementing this? Would implementation be any different if my submit
 buttons are ajax themed?

 Thanks
 --
 View this message in context:
 http://www.nabble.com/-S2--Multiple-Submits-with-different-actions-in-a-Form-tf4140299.html#a11776889
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Multiple-Submits-with-different-actions-in-a-Form-tf4140299.html#a11803845
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Multiple Submits with different actions in a Form

2007-07-25 Thread Richard Sayre

I'm not sure if this is what your are looking for, it is doing the
control logic on the client side. Instead of using s:submit to submit
the form you could make 3 input buttons:

input type=button  onClick=doAction1()/
input type=button  onClick=doAction2()/
input type=button  onClick=doAction3()/

and the write the following javascript:

function doAction1() {

  document.getElementById(formId).action = 's:url action=myAction1'/;
  document.getElementById(formId).submit();

}

function doAction2() {

  document.getElementById(formId).action = 's:url action=myAction2'/;
  document.getElementById(formId).submit();

}

function doAction3() {

  document.getElementById(formId).action = 's:url action=myAction3'/;
  document.getElementById(formId).submit();

}

then in your struts.xml:

action name=myAction1 class=MyAction method=method1
.
.
.
/action


action name=myAction2 class=MyAction method=method2
.
.
.
/action


action name=myAction3 class=MyAction method=method3
.
.
.
/action

You don't have to use the Ajax theme on your form, you can write the
Javascript using the DOJO library your self.  All the nessary files
are included when you use the s:head tag

On 7/25/07, Grish [EMAIL PROTECTED] wrote:


I'm still in the process of learning S2 and I was curious on what's the best
practice in implementing a form with multiple submit buttons

I've read that there are multiple way to implement this.
One way is here:
http://struts.apache.org/2.0.8/docs/multiple-submit-buttons.html
Although I was thinking I had to redo my setup of my action class and have
all the actions point to one method - execute() and from there i would check
a parameter to determine what my next step would be:

public String execute() {
  if (method.equals(searchMethod)) {
 doSearch();
 return SUCCESS;
  }
  if (method.equals(addMethod)) {
 doAdd();
 return SUCCESS;
  }
   }

something to that effect.

But I also wanted to try having an action class with different methods and
in my struts.xml the different actions would point to the different methods
of my action class.

My problem though is I have a form with multiple submit buttons. I tried
specifying the action on each submit button but the action in my form
overrides the action specified in the buttons. I tried removing the action
parameter in my form but it would take the current action and still override
the actions specified in the buttons. How do I have a form with multiple
submit buttons with different actions? What would be the best practice in
implementing this? Would implementation be any different if my submit
buttons are ajax themed?

Thanks
--
View this message in context: 
http://www.nabble.com/-S2--Multiple-Submits-with-different-actions-in-a-Form-tf4140299.html#a11776889
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]