html:form array submit, capture inside ActionFrom question

2007-04-20 Thread john lee
possible for me to implement the following code?
   
  % 
for (i=1:i=10:i++) 
{
   response.Write(html:form action='sth.do'  styleId=+i);
   response.Write(html:text property=part value=+i);
   response.Write(html:submit/);
   response.Write(/html:form); 
   }
  %
   
  but, how to capature form(0), form(1) with corrsponsed part inside ActionForm 
?
   
  tks in advance
   
  john
   

   
-
Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos.

Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread Dave Newton
--- john lee [EMAIL PROTECTED] wrote:
 possible for me to implement the following code?
   % 
 for (i=1:i=10:i++) 
 {
response.Write(html:form action='sth.do' 
 styleId=+i);
response.Write(html:text property=part
 value=+i);
response.Write(html:submit/);
response.Write(/html:form); 
}
   %

   but, how to capature form(0), form(1) with
 corrsponsed part inside ActionForm ?

I don't think so, because the S1 tags won't be
compiled: you'll just get raw tags in the output.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread john lee
what is S1 tags? i still use struts 1.3.8.
   
  So, no possible to submit formay array?
   
  tks
   
  john

Dave Newton [EMAIL PROTECTED] wrote:
  --- john lee wrote:
 possible for me to implement the following code?
  for (i=1:i {
response.Write( styleId=+i);
response.Write( value=+i);
response.Write();
response.Write(); 
}
   %
 
 but, how to capature form(0), form(1) with
 corrsponsed part inside ActionForm ?

I don't think so, because the S1 tags won't be
compiled: you'll just get raw tags in the output.

d.


__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



   
-
Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos.

Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread David Conrad

On 4/20/07, john lee [EMAIL PROTECTED] wrote:

what is S1 tags? i still use struts 1.3.8.


Struts 1.x. S2 would be Struts 2.x. So, with 1.3.8, you are still using S1.


  So, no possible to submit formay array?

 possible for me to implement the following code?
  for (i=1:i {
response.Write( styleId=+i);
response.Write( value=+i);
response.Write();
response.Write();
}
   %

 but, how to capature form(0), form(1) with
 corrsponsed part inside ActionForm ?



I think you could get the Struts tags to be interpreted if you wrapped
them in a logic:iterate/ tag or a c:forEach/ tag, rather than in a
loop in a scriptlet. I can't imagine how it would work beyond that,
though. I guess since only one form is actually posted back, you'd be
OK as long as it went to an action with a form bean that matched the
form?

If the goal is just to have multiple submit buttons on the page that
do different things, you might try another approach:

Have one html:form/ with multiple html:submit/ tags, each one
having an onclick handler e.g.,

html:submit onclick=doSubmitOne() .../

Then, in Javascript, you could alter the action of the form like this:

function doSubmitOne() {
   var form = document.forms[myForm];
   form.action += ?method=submitOne;
   form.submit();
}

Thus, the action would become sth.do?method=submitOne, and then in
your Action class you would have a form bean that could handle all the
fields from all your separate forms, and one method for each submit
button that would look at just the fields appropriate to that action.
Does that make sense?

It might not be the cleanest method, but it's not unlike something
I've used in the past.

Good luck,
David Conrad

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



Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread john lee
David, tks for ur help.
   
  actually, my goal is to have multiple submit button on same page, do same 
thing, but carry different input value(different search result).
   
  john

David Conrad [EMAIL PROTECTED] wrote:
  On 4/20/07, john lee wrote:
 what is S1 tags? i still use struts 1.3.8.

Struts 1.x. S2 would be Struts 2.x. So, with 1.3.8, you are still using S1.

 So, no possible to submit formay array?

  possible for me to implement the following code?
   for (i=1:i {
  response.Write( styleId=+i);
  response.Write( value=+i);
  response.Write();
  response.Write();
  }
  %
 
  but, how to capature form(0), form(1) with
  corrsponsed part inside ActionForm ?


I think you could get the Struts tags to be interpreted if you wrapped
them in a tag or a tag, rather than in a
loop in a scriptlet. I can't imagine how it would work beyond that,
though. I guess since only one form is actually posted back, you'd be
OK as long as it went to an action with a form bean that matched the
form?

If the goal is just to have multiple submit buttons on the page that
do different things, you might try another approach:

Have one with multiple tags, each one
having an onclick handler e.g.,



Then, in Javascript, you could alter the action of the form like this:

function doSubmitOne() {
var form = document.forms[myForm];
form.action += ?method=submitOne;
form.submit();
}

Thus, the action would become sth.do?method=submitOne, and then in
your Action class you would have a form bean that could handle all the
fields from all your separate forms, and one method for each submit
button that would look at just the fields appropriate to that action.
Does that make sense?

It might not be the cleanest method, but it's not unlike something
I've used in the past.

Good luck,
David Conrad

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



   
-
Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos.