Reset button not working properly when page contains error

2004-02-16 Thread Marco Mistroni
Hi all,
I have a form which contains a reset button (html:reset) and
whenever I submit the form and got errors from Action class, it seems
that
the reset button does not work properly, since when I click on it it
does
not reset anything.. no matter if I specify my own custom javascript
method

anyone can help?

Thanx in advance and regards
Marco




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



Reset button not always working

2003-10-29 Thread ZYD
Dear all,

I have a Reset button on a Jsp page:

html:reset
 bean:message key=button.reset/
/html:reset

It works at first load. But when I forward to this page from other pages, this Reset 
button does nothing, it does not reset anything.

Does this problem sound familiar to you guys? 

cheers

bruce

Re: Reset button not always working

2003-10-29 Thread struts
The reset should change all values on your jsp page to those matching the 
html page, which would be populated by your ActionForm.

In other words, if you haven't changed any of the values on your web page, 
then the reset would appear to do nothing. Is that the behavior you're 
expecting, or are you expecting it to do something else?

It basically just resolves to the following html in the simplest case:
---
input type=reset name=reset value=Reset
---

At least that's my understanding.

Regards,
Oscar


On Wed, 29 Oct 2003, ZYD wrote:

 Dear all,
 
 I have a Reset button on a Jsp page:
 
 html:reset
  bean:message key=button.reset/
 /html:reset
 
 It works at first load. But when I forward to this page from other
 pages, this Reset button does nothing, it does not reset anything.
 
 Does this problem sound familiar to you guys? 
 
 cheers
 
 bruce
 


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



problem with reset button in DynaActionForm

2003-06-05 Thread Kommana, Sridhar
   Iam using Struts 1.1 beta 2 version.
   I have one zipcode search page.it has search criteria fields and search results 
table.

case:1
   If i enter search criteria and click on reset button it works fine.

case:2
   If i enter search criteria and click on search -- iam calling action where iam type 
casting as like: 
ZipForm form = (ZipForm) frm;
once search is performed.now if i click on reset button the search criteria values are 
not resetting to null.
   

ActionForm looks like:
public class ZipForm extends org.apache.struts.action.DynaActionForm {
private String searchZipCodeCity;

public void reset(ActionMapping mapping, HttpServletRequest request) {

searchZipCodeCity = null;
}
}

struts-config looks like:
form-bean name=zipform type=com.test.ZipForm
  form-property name=searchZipCodeCity type=java.lang.String /
/form-bean

Where iam doing wrong?

Thanks,

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



RE: problem with reset button in DynaActionForm

2003-06-05 Thread Chen, Gin
Reset only resets back to the default values (it renders as an HTML submit)
Since struts puts the values into the html fields (value=blah) that is
picked up as the default values.
Therefore, reset will reset back to what the screen looked like when you
first came in before doing any posts.
-Tim

-Original Message-
From: Kommana, Sridhar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 11:52 AM
To: Struts Users Mailing List
Subject: problem with reset button in DynaActionForm


   Iam using Struts 1.1 beta 2 version.
   I have one zipcode search page.it has search criteria fields and search
results table.

case:1
   If i enter search criteria and click on reset button it works fine.

case:2
   If i enter search criteria and click on search -- iam calling action
where iam type casting as like: 
ZipForm form = (ZipForm) frm;
once search is performed.now if i click on reset button the search criteria
values are not resetting to null.
   

ActionForm looks like:
public class ZipForm extends org.apache.struts.action.DynaActionForm {
private String searchZipCodeCity;

public void reset(ActionMapping mapping, HttpServletRequest request) {

searchZipCodeCity = null;
}
}

struts-config looks like:
form-bean name=zipform type=com.test.ZipForm
  form-property name=searchZipCodeCity type=java.lang.String /
/form-bean

Where iam doing wrong?

Thanks,

-
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]



RE: problem with reset button in DynaActionForm

2003-06-05 Thread Andrew Hill
I never use the Reset button myself, but afaik its just an html reset button
(the clicking of which resets form properties to the values they started
with when the browser loaded the page (doesnt cause a hit on the server))
and thus has no relation with the actionforms reset() method.

-Original Message-
From: Kommana, Sridhar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 4 June 2003 23:52
To: Struts Users Mailing List
Subject: problem with reset button in DynaActionForm


   Iam using Struts 1.1 beta 2 version.
   I have one zipcode search page.it has search criteria fields and search
results table.

case:1
   If i enter search criteria and click on reset button it works fine.

case:2
   If i enter search criteria and click on search -- iam calling action
where iam type casting as like:
ZipForm form = (ZipForm) frm;
once search is performed.now if i click on reset button the search criteria
values are not resetting to null.


ActionForm looks like:
public class ZipForm extends org.apache.struts.action.DynaActionForm {
private String searchZipCodeCity;

public void reset(ActionMapping mapping, HttpServletRequest request) {

searchZipCodeCity = null;
}
}

struts-config looks like:
form-bean name=zipform type=com.test.ZipForm
  form-property name=searchZipCodeCity type=java.lang.String /
/form-bean

Where iam doing wrong?

Thanks,

-
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]



[NEWBIE]Clear fields on a DynaValidatorForm and Reset button

2003-03-19 Thread Marco Tedone
Hi all,

I'm using a DynaValidatorForm for my login page with the following text
fields:

userName
password
dbName

I configured all the properties of the DynaValidatorForm in the form-beans
element with the initial attribute set to blanks. The first time I access
the form everything is fine; then I submit it, and correctly the next JSP
page is shown. In this JSP page I've got a link which call the ForwardAction
which will address the user to the Login page again; this time the values I
entered the first time are still there, while I was expecting to find blanks
in the userName and password(as the dbName is filled dynamically at
runtime). Shall I subclass the DynaValidatorForm and override the reset()
method? In this case, I should declare the userName and password properties
in order to clear them in the reset() method...What would it happen to the
properties declared in the struts-config.xml file?

Reset Button:
-

In the same page I inserted two buttons: html:submit... / and
html:reset... The second time I access the Login page, when I press the
reset button nothing happens, while I would expect the userName and password
fields to be cleared. Am I missing something?

Marco 

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



Re: Reset button.

2003-02-11 Thread Gus Delgado
This work thanks, here is the code for anyone else who is interested.
script language=JavaScript1.2
function resetForm(myForm)
 {
 for(i=0, n=myForm.elements.length; i n; i++)
   {
   var theElement = myForm.elements[i];
   if (theElement.type == 'text') {
   theElement.value = '';
   }
   }
 }
/script

html:reset onclick=resetForm(this); return false;Reset/html:reset


Gus Delgado wrote:


no, not really, I'll give it a try thank you!

-gus
Durham David Cntr 805CSS/SCBE wrote:


Gus, try going back a few posts to the javascript stuff.  I think 
it's more in line with your original question.  As a test try putting:
input type=reset 
onClick=nameOfYourForm.firstTextField.value='';return false;

on your page.  replace nameOfYourForm and firstTextField with the 
appropriate names.

I think you'll start to see where this is going.

It's not hard, and there isn't a need for server side processing, 
unless there is, well, a need for server side processing.  Is there?  
You haven't mentioned any.

-Dave



 

-Original Message-
From: Gus Delgado [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 10, 2003 3:14 PM
To: Struts Users Mailing List
Subject: Re: Reset button.


isReset() who's method is that, action, form?

I can't seem to find it.

-Gus
Jacky Kimmel wrote:

  

if (isReset(httpServletRequest)){
   return actionMapping.findForward(Constants.D_RESET);
   }

As you can see, I had a constants class that I refer to.  

Also, in the struts-config.xml I have mapped this forward back to 
the original jsp.  I put this snippet of code in the beginning of 
each action class I have.

Gus Delgado [EMAIL PROTECTED] wrote:how do I 

check for the reset in the Action?
  

Jacky Kimmel wrote:





It sounds like your action does not check to see if the   


reset was clicked or not. What I have done is do this check at the 
beginning of all my action classes. If the reset has been selected 
then the action is redirected to the empty jsp. It sounds like your 
action mapping may also not be corrected in your config file.
  

Gus Delgado wrote:I have created a JSP with a Submit and   


Reset button both using the   

and tags. When I first render the page the reset works just fine, 
but if I hit the submit button and   


the page gets   

render again, I try to hit the reset and the form does not   


get clear   

anymore, the reset button does not work anymore, any ideas   


of why this   

is happening? any ways to fix it?

thank you

-Gus



  


-
  

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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


 
  


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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now





-
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]


.

 




-
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]




Reset button.

2003-02-10 Thread Gus Delgado
I have created a JSP with a Submit and Reset button both using the 
html:submit and html:reset tags. When I first render the page the 
reset works just fine, but if I hit the submit button and the page gets 
render again, I try to hit the reset and the form does not get clear 
anymore, the reset button does not work anymore, any ideas of why this 
is happening? any ways to fix it?

thank you

-Gus


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



Re: Reset button.

2003-02-10 Thread Jacky Kimmel

It sounds like your action does not check to see if the reset was clicked or not.  
What I have done is do this check at the beginning of all my action classes.  If the 
reset has been selected then the action is redirected to the empty jsp.  It sounds 
like your action mapping may also not be corrected in your config file.
 Gus Delgado [EMAIL PROTECTED] wrote:I have created a JSP with a Submit 
and Reset button both using the 
and tags. When I first render the page the 
reset works just fine, but if I hit the submit button and the page gets 
render again, I try to hit the reset and the form does not get clear 
anymore, the reset button does not work anymore, any ideas of why this 
is happening? any ways to fix it?

thank you

-Gus


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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


Re: Reset button.

2003-02-10 Thread David Graham
An html reset button resets all form fields to their initial values.  Look 
at your html source and you will see something like
input type=text value=blah

The reset button is functioning properly.

David



From: Gus Delgado [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Reset button.
Date: Mon, 10 Feb 2003 13:47:49 -0500

I have created a JSP with a Submit and Reset button both using the 
html:submit and html:reset tags. When I first render the page the reset 
works just fine, but if I hit the submit button and the page gets render 
again, I try to hit the reset and the form does not get clear anymore, the 
reset button does not work anymore, any ideas of why this is happening? any 
ways to fix it?

thank you

-Gus


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


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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



RE: Reset button.

2003-02-10 Thread Durham David Cntr 805CSS/SCBE
Yeah, the reset button will return the form elements to their initial state.  If the 
initial state includes values, i.e. input type=text value=someValue,  then 
clicking reset will set the value of this element to someValue, it's original value.

One solution is to write a function that loops throught the form elements and set text 
inputs to '' and so on.

Something like input type=reset onclick=resetForm(this); return false;

and then function would be:  (untested)

resetForm(theForm) {
while (i = 0; i  theForm.elements.length; i++) {
theElement = theForm.elements[i];
if (theElement.type == 'text') {
theElement.value = '';
} else if (theElement.type == 'choose-one') {
theElement.selectedIndex = 1;
}

...
}

If you're not sure what the type attribute will be for a form element, then you can 
alert(theElement.type).  I might have some code I can dig up for this if you need more 
help.  

-Dave





 -Original Message-
 From: Gus Delgado [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 10, 2003 12:48 PM
 To: Struts Users Mailing List
 Subject: Reset button.
 
 
 I have created a JSP with a Submit and Reset button both 
 using the 
 html:submit and html:reset tags. When I first render the page the 
 reset works just fine, but if I hit the submit button and the 
 page gets 
 render again, I try to hit the reset and the form does not get clear 
 anymore, the reset button does not work anymore, any ideas of 
 why this 
 is happening? any ways to fix it?
 
 thank you
 
 -Gus
 
 
 -
 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]




Re: Reset button.

2003-02-10 Thread Gus Delgado
how do I check for the reset in the Action?

Jacky Kimmel wrote:


It sounds like your action does not check to see if the reset was clicked or not.  What I have done is do this check at the beginning of all my action classes.  If the reset has been selected then the action is redirected to the empty jsp.  It sounds like your action mapping may also not be corrected in your config file.
Gus Delgado [EMAIL PROTECTED] wrote:I have created a JSP with a Submit and Reset button both using the 
and tags. When I first render the page the 
reset works just fine, but if I hit the submit button and the page gets 
render again, I try to hit the reset and the form does not get clear 
anymore, the reset button does not work anymore, any ideas of why this 
is happening? any ways to fix it?

thank you

-Gus


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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
 




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




Re: Reset button.

2003-02-10 Thread Jacky Kimmel

if (isReset(httpServletRequest)) 
 {
 return actionMapping.findForward(Constants.D_RESET);
 }

As you can see, I had a constants class that I refer to.  Also, in the 
struts-config.xml I have mapped this forward back to the original jsp.  I put this 
snippet of code in the beginning of each action class I have.  

 Gus Delgado [EMAIL PROTECTED] wrote:how do I check for the reset in the 
Action?

Jacky Kimmel wrote:

It sounds like your action does not check to see if the reset was clicked or not. 
What I have done is do this check at the beginning of all my action classes. If the 
reset has been selected then the action is redirected to the empty jsp. It sounds 
like your action mapping may also not be corrected in your config file.
 Gus Delgado wrote:I have created a JSP with a Submit and Reset button both using 
the 
and tags. When I first render the page the 
reset works just fine, but if I hit the submit button and the page gets 
render again, I try to hit the reset and the form does not get clear 
anymore, the reset button does not work anymore, any ideas of why this 
is happening? any ways to fix it?

thank you

-Gus


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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
 




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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


Re: Reset button.

2003-02-10 Thread Gus Delgado
isReset() who's method is that, action, form?

I can't seem to find it.

-Gus
Jacky Kimmel wrote:


if (isReset(httpServletRequest)) 
{
return actionMapping.findForward(Constants.D_RESET);
}

As you can see, I had a constants class that I refer to.  Also, in the struts-config.xml I have mapped this forward back to the original jsp.  I put this snippet of code in the beginning of each action class I have.  

Gus Delgado [EMAIL PROTECTED] wrote:how do I check for the reset in the Action?

Jacky Kimmel wrote:

 

It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file.
Gus Delgado wrote:I have created a JSP with a Submit and Reset button both using the 
and tags. When I first render the page the 
reset works just fine, but if I hit the submit button and the page gets 
render again, I try to hit the reset and the form does not get clear 
anymore, the reset button does not work anymore, any ideas of why this 
is happening? any ways to fix it?

thank you

-Gus


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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


   




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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
 




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




RE: Reset button.

2003-02-10 Thread Durham David Cntr 805CSS/SCBE
Gus, try going back a few posts to the javascript stuff.  I think it's more in line 
with your original question.  As a test try putting: 

input type=reset onClick=nameOfYourForm.firstTextField.value='';return false;

on your page.  replace nameOfYourForm and firstTextField with the appropriate names.

I think you'll start to see where this is going.

It's not hard, and there isn't a need for server side processing, unless there is, 
well, a need for server side processing.  Is there?  You haven't mentioned any.

-Dave



 -Original Message-
 From: Gus Delgado [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 10, 2003 3:14 PM
 To: Struts Users Mailing List
 Subject: Re: Reset button.
 
 
 isReset() who's method is that, action, form?
 
 I can't seem to find it.
 
 -Gus
 Jacky Kimmel wrote:
 
 if (isReset(httpServletRequest)) 
  {
  return actionMapping.findForward(Constants.D_RESET);
  }
 
 As you can see, I had a constants class that I refer to.  
 Also, in the struts-config.xml I have mapped this forward 
 back to the original jsp.  I put this snippet of code in the 
 beginning of each action class I have.  
 
  Gus Delgado [EMAIL PROTECTED] wrote:how do I 
 check for the reset in the Action?
 
 Jacky Kimmel wrote:
 
   
 
 It sounds like your action does not check to see if the 
 reset was clicked or not. What I have done is do this check 
 at the beginning of all my action classes. If the reset has 
 been selected then the action is redirected to the empty jsp. 
 It sounds like your action mapping may also not be corrected 
 in your config file.
 Gus Delgado wrote:I have created a JSP with a Submit and 
 Reset button both using the 
 and tags. When I first render the page the 
 reset works just fine, but if I hit the submit button and 
 the page gets 
 render again, I try to hit the reset and the form does not 
 get clear 
 anymore, the reset button does not work anymore, any ideas 
 of why this 
 is happening? any ways to fix it?
 
 thank you
 
 -Gus
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now
   
 
 
 
 
 -
 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]




Re: Reset button.

2003-02-10 Thread Gus Delgado
no, not really, I'll give it a try thank you!

-gus
Durham David Cntr 805CSS/SCBE wrote:


Gus, try going back a few posts to the javascript stuff.  I think it's more in line with your original question.  As a test try putting: 

input type=reset onClick=nameOfYourForm.firstTextField.value='';return false;

on your page.  replace nameOfYourForm and firstTextField with the appropriate names.

I think you'll start to see where this is going.

It's not hard, and there isn't a need for server side processing, unless there is, well, a need for server side processing.  Is there?  You haven't mentioned any.

-Dave



 

-Original Message-
From: Gus Delgado [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 10, 2003 3:14 PM
To: Struts Users Mailing List
Subject: Re: Reset button.


isReset() who's method is that, action, form?

I can't seem to find it.

-Gus
Jacky Kimmel wrote:

   

if (isReset(httpServletRequest)) 
   {
   return actionMapping.findForward(Constants.D_RESET);
   }

As you can see, I had a constants class that I refer to.  
 

Also, in the struts-config.xml I have mapped this forward 
back to the original jsp.  I put this snippet of code in the 
beginning of each action class I have.  
   

Gus Delgado [EMAIL PROTECTED] wrote:how do I 
 

check for the reset in the Action?
   

Jacky Kimmel wrote:



 

It sounds like your action does not check to see if the 
   

reset was clicked or not. What I have done is do this check 
at the beginning of all my action classes. If the reset has 
been selected then the action is redirected to the empty jsp. 
It sounds like your action mapping may also not be corrected 
in your config file.
   

Gus Delgado wrote:I have created a JSP with a Submit and 
   

Reset button both using the 
   

and tags. When I first render the page the 
reset works just fine, but if I hit the submit button and 
   

the page gets 
   

render again, I try to hit the reset and the form does not 
   

get clear 
   

anymore, the reset button does not work anymore, any ideas 
   

of why this 
   

is happening? any ways to fix it?

thank you

-Gus



   

-
   

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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


  

   


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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


 


-
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]


.

 




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




RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread Leblon Jean-marc

If i understand your problem, I had same problem last week, this is my solution 

in the formbean : 
   public void reset(ActionMapping mapping, HttpServletRequest request)
   {  
// init formbean
setText_search( );
setType_search(Begin);
   } 

   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
   {  


// if action is not triggered by reset button, validate the data
if (request.getParameter(reset) == null)
{
  ...

   }
}
else  // if action triggered by reset button, initialise data
   {
   reset(mapping, request);
   request.removeAttribute(reset);
   }   
 
return errors;
   }

in the jsp : 
   html:form method=POST  action=/freeSearch.do 
html:radio property=type_search value=Begin/ A 
BR
html:radio property=type_search value=Middle / B
BR
html:text  property=text_search size=40 maxlength=80/
html:submit value=Search /
html:submit  value=reset property=reset/
 /html:form

JML
[EMAIL PROTECTED]


-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] 
Sent: jeudi 1 août 2002 00:04
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


I am not sure what are you talking about.
Anyway, if you have a suggestion please 
let me know. What I explained you wasn't
clear I guess.I press the reset button and 
the radio buttons don't get cleared. Any
ideas ?(only one this time) 
Thanks
Priyank

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 5:46 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Ok, first of all,  its probably not a good idea to have.. 'when the user hits the back 
button it should...' in any of your use casesbut since we all deal the cards we 
are dealt, lets deal with this.

The user hitting the back button has nothing to do with the scope of your bean. When 
the user hits back, the page is pulled from memory on the users pc (or from disk, 
depending on which browser and version)

If the user then hits the reset button, the form should clear back to original values.

This reminds me about a debate I had with PHBs over the difference between resetting 
the form and clearing the form.  They lost of course.

Anyway, hope that helps you a little.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network 
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:13 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I need the bean in Session scope , so that
 when the user returns to the same page using
 the back button he should see the radio buttons
 selected. He should not lose the selections.Only
 when he presses the reset button the radio buttons
 should clear.Any ideas , how to do it ???
 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:09 PM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 What scope did you define for this formbean?

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network 
 http://www.open-tools.org/struts-atlanta




  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:50 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Yeah I figured that out. But my problem is little tricky.
  I have a set of radio buttons and when I select them , the selected 
  values automatically get set in a String[]. Now, when I try to reset 
  the values back to the original state i.e. all radio buttons 
  unselected , I just reset the String[] back to the original state in 
  the reset method. When I click the reset button I should see all 
  radio radio buttons getting unselected but it's not happening. 
  Something wrong with my browser settings :( Any help Keith ..
 
  Thanks
  Priyank
 
  -Original Message-
  From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:39 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Hey,
  This is a mistake I made at first too.  One would assume that a 
  reset button would call the reset method, but this is not the case.  
  The reset method is
  called when an action is forwarding to a JSP with a form/form
 bean.  It's
  mainly used to set the boolean properties

RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread Gupta, Priyank x57787

Hi JML,
 Thanks for your response. I think using html:submit  value=reset
property=reset/
will post the form and take me to the next page or the same if I have that
mapping
in struts-config.xml. But, is there a way to reset the radio buttons to
unselected 
values without server round trip using some javascript .
Thanks
Priyank

-Original Message-
From: Leblon Jean-marc [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 4:14 AM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


If i understand your problem, I had same problem last week, this is my
solution 

in the formbean : 
   public void reset(ActionMapping mapping, HttpServletRequest request)
   {  
// init formbean
setText_search( );
setType_search(Begin);
   } 

   public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request)
   {  


// if action is not triggered by reset button, validate the data
if (request.getParameter(reset) == null)
{
  ...

   }
}
else  // if action triggered by reset button, initialise data
   {
   reset(mapping, request);
   request.removeAttribute(reset);
   }   
 
return errors;
   }

in the jsp : 
   html:form method=POST  action=/freeSearch.do 
html:radio property=type_search value=Begin/ A 
BR
html:radio property=type_search value=Middle / B
BR
html:text  property=text_search size=40
maxlength=80/
html:submit value=Search /
html:submit  value=reset property=reset/
 /html:form

JML
[EMAIL PROTECTED]


-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] 
Sent: jeudi 1 août 2002 00:04
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


I am not sure what are you talking about.
Anyway, if you have a suggestion please 
let me know. What I explained you wasn't
clear I guess.I press the reset button and 
the radio buttons don't get cleared. Any
ideas ?(only one this time) 
Thanks
Priyank

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 5:46 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Ok, first of all,  its probably not a good idea to have.. 'when the user
hits the back button it should...' in any of your use casesbut since we
all deal the cards we are dealt, lets deal with this.

The user hitting the back button has nothing to do with the scope of your
bean. When the user hits back, the page is pulled from memory on the users
pc (or from disk, depending on which browser and version)

If the user then hits the reset button, the form should clear back to
original values.

This reminds me about a debate I had with PHBs over the difference between
resetting the form and clearing the form.  They lost of course.

Anyway, hope that helps you a little.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:13 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I need the bean in Session scope , so that
 when the user returns to the same page using
 the back button he should see the radio buttons
 selected. He should not lose the selections.Only
 when he presses the reset button the radio buttons
 should clear.Any ideas , how to do it ???
 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:09 PM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 What scope did you define for this formbean?

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network 
 http://www.open-tools.org/struts-atlanta




  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:50 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Yeah I figured that out. But my problem is little tricky.
  I have a set of radio buttons and when I select them , the selected 
  values automatically get set in a String[]. Now, when I try to reset 
  the values back to the original state i.e. all radio buttons 
  unselected , I just reset the String[] back to the original state in 
  the reset method. When I click the reset button I should see all 
  radio radio buttons getting unselected but it's not happening. 
  Something wrong with my browser settings :( Any help Keith ..
 
  Thanks
  Priyank

RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread Leblon Jean-marc

sorry no idea, have i had a solution to my problem, I didnt look further :)


JML
[EMAIL PROTECTED]





-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] 
Sent: jeudi 1 août 2002 14:45
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


Hi JML,
 Thanks for your response. I think using html:submit  value=reset 
property=reset/ will post the form and take me to the next page or the same if I 
have that mapping in struts-config.xml. But, is there a way to reset the radio buttons 
to unselected 
values without server round trip using some javascript .
Thanks
Priyank

-Original Message-
From: Leblon Jean-marc [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 4:14 AM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


If i understand your problem, I had same problem last week, this is my solution 

in the formbean : 
   public void reset(ActionMapping mapping, HttpServletRequest request)
   {  
// init formbean
setText_search( );
setType_search(Begin);
   } 

   public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request)
   {  


// if action is not triggered by reset button, validate the data
if (request.getParameter(reset) == null)
{
  ...

   }
}
else  // if action triggered by reset button, initialise data
   {
   reset(mapping, request);
   request.removeAttribute(reset);
   }   
 
return errors;
   }

in the jsp : 
   html:form method=POST  action=/freeSearch.do 
html:radio property=type_search value=Begin/ A 
BR
html:radio property=type_search value=Middle / B
BR
html:text  property=text_search size=40 maxlength=80/
html:submit value=Search /
html:submit  value=reset property=reset/
 /html:form

JML
[EMAIL PROTECTED]


-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] 
Sent: jeudi 1 août 2002 00:04
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


I am not sure what are you talking about.
Anyway, if you have a suggestion please 
let me know. What I explained you wasn't
clear I guess.I press the reset button and 
the radio buttons don't get cleared. Any
ideas ?(only one this time) 
Thanks
Priyank

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 5:46 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Ok, first of all,  its probably not a good idea to have.. 'when the user hits the back 
button it should...' in any of your use casesbut since we all deal the cards we 
are dealt, lets deal with this.

The user hitting the back button has nothing to do with the scope of your bean. When 
the user hits back, the page is pulled from memory on the users pc (or from disk, 
depending on which browser and version)

If the user then hits the reset button, the form should clear back to original values.

This reminds me about a debate I had with PHBs over the difference between resetting 
the form and clearing the form.  They lost of course.

Anyway, hope that helps you a little.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network 
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:13 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I need the bean in Session scope , so that
 when the user returns to the same page using
 the back button he should see the radio buttons
 selected. He should not lose the selections.Only
 when he presses the reset button the radio buttons
 should clear.Any ideas , how to do it ???
 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:09 PM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 What scope did you define for this formbean?

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://www.open-tools.org/struts-atlanta




  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:50 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Yeah I figured that out. But my problem is little tricky.
  I have a set of radio buttons and when I select them , the selected
  values automatically get set in a String[]. Now, when I try to reset 
  the values back to the original

RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread James Mitchell

Yes, use the reset button...

html:reset value=Reset

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta


 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 8:45 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hi JML,
  Thanks for your response. I think using html:submit  value=reset
 property=reset/
 will post the form and take me to the next page or the same if I have that
 mapping
 in struts-config.xml. But, is there a way to reset the radio buttons to
 unselected
 values without server round trip using some javascript .
 Thanks
 Priyank


snip/


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




RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread Gupta, Priyank x57787

Hey
 I am using the reset button and it's not working .
Try to be serious on the mailing lists , it's not
your personal , alright.If you have some real solution
please let me know.
Thanks
Priyank

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 10:46 AM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Yes, use the reset button...

html:reset value=Reset

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta


 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 8:45 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hi JML,
  Thanks for your response. I think using html:submit  value=reset
 property=reset/
 will post the form and take me to the next page or the same if I have that
 mapping
 in struts-config.xml. But, is there a way to reset the radio buttons to
 unselected
 values without server round trip using some javascript .
 Thanks
 Priyank


snip/


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



RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread James Mitchell

I'm trying to help you, but I'm not understanding what problems you are
having.

Please describe your use case further.

Example:
Use Case: Complete Personal Information

#1. The user fills out form.
Form:
 Textbox (firstname):
  - Max=10 chars
  - Required=lowercase
 Textbox (lastname):
  - Max=10 chars
  - Required=lowercase
 Radio Button Choice (age-range)
   - values coming from application scope bean (mychoices)
   - Choices are (Iteration 1):
  Key   Value
  1 0  to 21
  2 22 to 40
  3 41 to 60
  4 over 60

Action choices:
 Submit - form is submitted, go to #2
 Cancel - form is cancelled, go to main menu
 Reset  - form is reset (this is an html reset)
 Clear  - form is cleared of all values

#2  When submitted, should save to database
Known Exceptions:
 a. Validation errors - (reference validation table)
 b. Connection errors - (same as above)
 c. blah, blah, blah

#3  Re-Display information (as it was saved)
Action choices:
 a. user must use top level navigation to continue
 b. User hits back button - (this behavior is
disallowed, and enforced with form-based
token validation)



Now, expecting functionality from anything after the user hits the back
button should not be allowed, but as I mentioned in a prior emailif you
do this...

myform.jsp  - /doForm.do  - myresults.jsp

...then if the user hits the back button, if (and only IF) the form did NOT
have radios selected, the radios should clear.

**THIS IS IMPORTANT**
Given the same scenario as above, if there are validation errors and the
user is return to the 'myform.jsp' hitting the reset button ***WILL NOT***
reset the fields to what they were before the user hit submit.
Now, if the user hits the back button right now, and the hit the reset
button, then yes, it will do as I said above.


I hope this helps you, if not, then please provide us with more to go on.



James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 10:52 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hey
  I am using the reset button and it's not working .
 Try to be serious on the mailing lists , it's not
 your personal , alright.If you have some real solution
 please let me know.
 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 10:46 AM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Yes, use the reset button...

 html:reset value=Reset

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://www.open-tools.org/struts-atlanta


  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, August 01, 2002 8:45 AM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Hi JML,
   Thanks for your response. I think using html:submit  value=reset
  property=reset/
  will post the form and take me to the next page or the same if
 I have that
  mapping
  in struts-config.xml. But, is there a way to reset the radio buttons to
  unselected
  values without server round trip using some javascript .
  Thanks
  Priyank
 

 snip/


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



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




RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread Gupta, Priyank x57787

Hey,

 This explanation is awesome.
...then if the user hits the back button, if (and only IF) the form did NOT
have radios selected, the radios should clear. 
The above scenario in my case is :
...then if the user hits the back button, the form did HAVE
 radios selected, the radios should clear. How to do that ?

Thanks
Priyank

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 11:20 AM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


I'm trying to help you, but I'm not understanding what problems you are
having.

Please describe your use case further.

Example:
Use Case: Complete Personal Information

#1. The user fills out form.
Form:
 Textbox (firstname):
  - Max=10 chars
  - Required=lowercase
 Textbox (lastname):
  - Max=10 chars
  - Required=lowercase
 Radio Button Choice (age-range)
   - values coming from application scope bean (mychoices)
   - Choices are (Iteration 1):
  Key   Value
  1 0  to 21
  2 22 to 40
  3 41 to 60
  4 over 60

Action choices:
 Submit - form is submitted, go to #2
 Cancel - form is cancelled, go to main menu
 Reset  - form is reset (this is an html reset)
 Clear  - form is cleared of all values

#2  When submitted, should save to database
Known Exceptions:
 a. Validation errors - (reference validation table)
 b. Connection errors - (same as above)
 c. blah, blah, blah

#3  Re-Display information (as it was saved)
Action choices:
 a. user must use top level navigation to continue
 b. User hits back button - (this behavior is
disallowed, and enforced with form-based
token validation)



Now, expecting functionality from anything after the user hits the back
button should not be allowed, but as I mentioned in a prior emailif you
do this...

myform.jsp  - /doForm.do  - myresults.jsp

...then if the user hits the back button, if (and only IF) the form did NOT
have radios selected, the radios should clear.

**THIS IS IMPORTANT**
Given the same scenario as above, if there are validation errors and the
user is return to the 'myform.jsp' hitting the reset button ***WILL NOT***
reset the fields to what they were before the user hit submit.
Now, if the user hits the back button right now, and the hit the reset
button, then yes, it will do as I said above.


I hope this helps you, if not, then please provide us with more to go on.



James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 10:52 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hey
  I am using the reset button and it's not working .
 Try to be serious on the mailing lists , it's not
 your personal , alright.If you have some real solution
 please let me know.
 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 10:46 AM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Yes, use the reset button...

 html:reset value=Reset

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://www.open-tools.org/struts-atlanta


  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, August 01, 2002 8:45 AM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Hi JML,
   Thanks for your response. I think using html:submit  value=reset
  property=reset/
  will post the form and take me to the next page or the same if
 I have that
  mapping
  in struts-config.xml. But, is there a way to reset the radio buttons to
  unselected
  values without server round trip using some javascript .
  Thanks
  Priyank
 

 snip/


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



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



RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread James Mitchell

Ok, then what are wanting is 'Clear' functionality, not 'Reset'
functionality.

You need to decide which form elements you want cleared, and just throw in
the script.

Here's some sample code for ya:
form name=frm action=? method=GET
INPUT type=radio name=rdo value=test1test1br
INPUT type=radio name=rdo value=test2 checkedtest2br
INPUT type=radio name=rdo value=test3test3br
INPUT type=submit value=Submit name=submit
INPUT type=reset value=Reset id=reset1 name=reset1
input type=button value=Clear Form onclick=resetForm()
/form
SCRIPT LANGUAGE=javascript
!--
function resetForm(){
dml=document.forms[0];
len = dml.elements.length;
var i=0;
for( i = 0 ; i  len ; i++) {
if (dml.elements[i].type=='radio') {
dml.elements[i].checked=false;
}
}
}
//--
/SCRIPT


If you put this in a simple htm file and open it in a browser, you'll notice
a couple of things:
-there are 3 radio buttons (the 2nd one is selected by default)
-there are 3 choices to make (submit, reset, and clear)
-by having action=? as the action in the form, if you hit
 submit, the form submits to itself. (I also posted with GET so
 you can see the value in the address bar)

1. Hit the submit button.  The form just redisplays with a new URL.
2. Now hit the reset button.  Nothing happens.
3. Choose a different radio button and hit Reset.  It just goes back
   to the 2nd one.
4. Choose a different radio button and hit Clear.  I think that's
   what you want.


Let me know if that's not what you are trying to do.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 11:29 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hey,

  This explanation is awesome.
 ...then if the user hits the back button, if (and only IF) the
 form did NOT
 have radios selected, the radios should clear.
 The above scenario in my case is :
 ...then if the user hits the back button, the form did HAVE
  radios selected, the radios should clear. How to do that ?

 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 11:20 AM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I'm trying to help you, but I'm not understanding what problems you are
 having.

 Please describe your use case further.

 Example:
 Use Case: Complete Personal Information

 #1. The user fills out form.
 Form:
  Textbox (firstname):
   - Max=10 chars
   - Required=lowercase
  Textbox (lastname):
   - Max=10 chars
   - Required=lowercase
  Radio Button Choice (age-range)
- values coming from application scope bean (mychoices)
- Choices are (Iteration 1):
   Key   Value
   1 0  to 21
   2 22 to 40
   3 41 to 60
   4 over 60

 Action choices:
  Submit - form is submitted, go to #2
  Cancel - form is cancelled, go to main menu
  Reset  - form is reset (this is an html reset)
  Clear  - form is cleared of all values

 #2  When submitted, should save to database
 Known Exceptions:
  a. Validation errors - (reference validation table)
  b. Connection errors - (same as above)
  c. blah, blah, blah

 #3  Re-Display information (as it was saved)
 Action choices:
  a. user must use top level navigation to continue
  b. User hits back button - (this behavior is
 disallowed, and enforced with form-based
 token validation)


 
 Now, expecting functionality from anything after the user hits the back
 button should not be allowed, but as I mentioned in a prior
 emailif you
 do this...

 myform.jsp  - /doForm.do  - myresults.jsp

 ...then if the user hits the back button, if (and only IF) the
 form did NOT
 have radios selected, the radios should clear.

 **THIS IS IMPORTANT**
 Given the same scenario as above, if there are validation errors and the
 user is return to the 'myform.jsp' hitting the reset button ***WILL NOT***
 reset the fields to what they were before the user hit submit.
 Now, if the user hits the back button right now, and the hit the reset
 button, then yes, it will do as I said above.


 I hope this helps you, if not, then please provide us with more to go on.



 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://www.open-tools.org/struts-atlanta




  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, August 01, 2002 10:52 AM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button

RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread Kamholz, Keith (corp-staff) USX

Hey,
  I don't know if anyone cares, but what I usually do is put a clear method
in most of my ActionForms.  In my JSP, I have a link to clear the form by
simply going to an action and sending a parameter telling it to clear the
ActionForm.  It's a very nice little thing, it avoids JavaScript and is much
easier to use.  It's also much more reusable if I want to be able to clear
the form from a couple different pages, because I just have to throw in a
link instead of blocks of code.

~ Keith
http://www.buffalo.edu/~kkamholz



-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


Thanks James.
I greatly appreciate your help. 


-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 12:10 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Ok, then what are wanting is 'Clear' functionality, not 'Reset'
functionality.

You need to decide which form elements you want cleared, and just throw in
the script.

Here's some sample code for ya:
form name=frm action=? method=GET
INPUT type=radio name=rdo value=test1test1br
INPUT type=radio name=rdo value=test2 checkedtest2br
INPUT type=radio name=rdo value=test3test3br
INPUT type=submit value=Submit name=submit
INPUT type=reset value=Reset id=reset1 name=reset1
input type=button value=Clear Form onclick=resetForm()
/form
SCRIPT LANGUAGE=javascript
!--
function resetForm(){
dml=document.forms[0];
len = dml.elements.length;
var i=0;
for( i = 0 ; i  len ; i++) {
if (dml.elements[i].type=='radio') {
dml.elements[i].checked=false;
}
}
}
//--
/SCRIPT


If you put this in a simple htm file and open it in a browser, you'll notice
a couple of things:
-there are 3 radio buttons (the 2nd one is selected by default)
-there are 3 choices to make (submit, reset, and clear)
-by having action=? as the action in the form, if you hit
 submit, the form submits to itself. (I also posted with GET so
 you can see the value in the address bar)

1. Hit the submit button.  The form just redisplays with a new URL.
2. Now hit the reset button.  Nothing happens.
3. Choose a different radio button and hit Reset.  It just goes back
   to the 2nd one.
4. Choose a different radio button and hit Clear.  I think that's
   what you want.


Let me know if that's not what you are trying to do.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 11:29 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hey,

  This explanation is awesome.
 ...then if the user hits the back button, if (and only IF) the
 form did NOT
 have radios selected, the radios should clear.
 The above scenario in my case is :
 ...then if the user hits the back button, the form did HAVE
  radios selected, the radios should clear. How to do that ?

 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 11:20 AM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I'm trying to help you, but I'm not understanding what problems you are
 having.

 Please describe your use case further.

 Example:
 Use Case: Complete Personal Information

 #1. The user fills out form.
 Form:
  Textbox (firstname):
   - Max=10 chars
   - Required=lowercase
  Textbox (lastname):
   - Max=10 chars
   - Required=lowercase
  Radio Button Choice (age-range)
- values coming from application scope bean (mychoices)
- Choices are (Iteration 1):
   Key   Value
   1 0  to 21
   2 22 to 40
   3 41 to 60
   4 over 60

 Action choices:
  Submit - form is submitted, go to #2
  Cancel - form is cancelled, go to main menu
  Reset  - form is reset (this is an html reset)
  Clear  - form is cleared of all values

 #2  When submitted, should save to database
 Known Exceptions:
  a. Validation errors - (reference validation table)
  b. Connection errors - (same as above)
  c. blah, blah, blah

 #3  Re-Display information (as it was saved)
 Action choices:
  a. user must use top level navigation to continue
  b. User hits back button - (this behavior is
 disallowed, and enforced with form-based
 token validation)


 
 Now, expecting functionality from anything after the user hits the back
 button should

RE: Reset button does not invoke the FormBean's reset()

2002-08-01 Thread Gupta, Priyank x57787

That's a good idea. I too wanted to avoid dirty javascript :)
Thanks
Priyank

-Original Message-
From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:34 PM
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


Hey,
  I don't know if anyone cares, but what I usually do is put a clear method
in most of my ActionForms.  In my JSP, I have a link to clear the form by
simply going to an action and sending a parameter telling it to clear the
ActionForm.  It's a very nice little thing, it avoids JavaScript and is much
easier to use.  It's also much more reusable if I want to be able to clear
the form from a couple different pages, because I just have to throw in a
link instead of blocks of code.

~ Keith
http://www.buffalo.edu/~kkamholz



-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


Thanks James.
I greatly appreciate your help. 


-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 12:10 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Ok, then what are wanting is 'Clear' functionality, not 'Reset'
functionality.

You need to decide which form elements you want cleared, and just throw in
the script.

Here's some sample code for ya:
form name=frm action=? method=GET
INPUT type=radio name=rdo value=test1test1br
INPUT type=radio name=rdo value=test2 checkedtest2br
INPUT type=radio name=rdo value=test3test3br
INPUT type=submit value=Submit name=submit
INPUT type=reset value=Reset id=reset1 name=reset1
input type=button value=Clear Form onclick=resetForm()
/form
SCRIPT LANGUAGE=javascript
!--
function resetForm(){
dml=document.forms[0];
len = dml.elements.length;
var i=0;
for( i = 0 ; i  len ; i++) {
if (dml.elements[i].type=='radio') {
dml.elements[i].checked=false;
}
}
}
//--
/SCRIPT


If you put this in a simple htm file and open it in a browser, you'll notice
a couple of things:
-there are 3 radio buttons (the 2nd one is selected by default)
-there are 3 choices to make (submit, reset, and clear)
-by having action=? as the action in the form, if you hit
 submit, the form submits to itself. (I also posted with GET so
 you can see the value in the address bar)

1. Hit the submit button.  The form just redisplays with a new URL.
2. Now hit the reset button.  Nothing happens.
3. Choose a different radio button and hit Reset.  It just goes back
   to the 2nd one.
4. Choose a different radio button and hit Clear.  I think that's
   what you want.


Let me know if that's not what you are trying to do.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 11:29 AM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hey,

  This explanation is awesome.
 ...then if the user hits the back button, if (and only IF) the
 form did NOT
 have radios selected, the radios should clear.
 The above scenario in my case is :
 ...then if the user hits the back button, the form did HAVE
  radios selected, the radios should clear. How to do that ?

 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 11:20 AM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I'm trying to help you, but I'm not understanding what problems you are
 having.

 Please describe your use case further.

 Example:
 Use Case: Complete Personal Information

 #1. The user fills out form.
 Form:
  Textbox (firstname):
   - Max=10 chars
   - Required=lowercase
  Textbox (lastname):
   - Max=10 chars
   - Required=lowercase
  Radio Button Choice (age-range)
- values coming from application scope bean (mychoices)
- Choices are (Iteration 1):
   Key   Value
   1 0  to 21
   2 22 to 40
   3 41 to 60
   4 over 60

 Action choices:
  Submit - form is submitted, go to #2
  Cancel - form is cancelled, go to main menu
  Reset  - form is reset (this is an html reset)
  Clear  - form is cleared of all values

 #2  When submitted, should save to database
 Known Exceptions:
  a. Validation errors - (reference validation table)
  b. Connection errors - (same as above)
  c. blah, blah, blah

 #3  Re-Display information (as it was saved)
 Action choices:
  a. user must use

Reset button does not invoke the FormBean's reset()

2002-07-31 Thread Gupta, Priyank x57787

Hi All,
 I am not able to invoke FromBean's reset() method from the browser.
I have a form with two buttons Submit and Reset. When I click the 
reset button I am not able to invoke the reset() of the FormBean.
Any help will be great.
Thanks
Priyank



RE: Reset button does not invoke the FormBean's reset()

2002-07-31 Thread Kamholz, Keith (corp-staff) USX

Hey,
This is a mistake I made at first too.  One would assume that a reset button
would call the reset method, but this is not the case.  The reset method is
called when an action is forwarding to a JSP with a form/form bean.  It's
mainly used to set the boolean properties associated with a checkbox to
false, so that they are correctly updated.  (Checkboxes kinda suck like
that).  The reset button is used differently.  It only gets rid of changes
made since you last submitted the form, meaning that it changes the fields
back to what they were when you arrived at the form.  The method and button
are two completely different things.  Does that make sense to you?
I hope this helps.

~ Keith
http://www.buffalo.edu/~kkamholz



-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 4:33 PM
To: 'Struts Users Mailing List'
Subject: Reset button does not invoke the FormBean's reset()


Hi All,
 I am not able to invoke FromBean's reset() method from the browser.
I have a form with two buttons Submit and Reset. When I click the 
reset button I am not able to invoke the reset() of the FormBean.
Any help will be great.
Thanks
Priyank

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




RE: Reset button does not invoke the FormBean's reset()

2002-07-31 Thread Gupta, Priyank x57787

Yeah I figured that out. But my problem is little tricky.
I have a set of radio buttons and when I select them , the
selected values automatically get set in a String[]. Now,
when I try to reset the values back to the original state
i.e. all radio buttons unselected , I just reset the String[]
back to the original state in the reset method. When I click the
reset button I should see all radio radio buttons getting unselected
but it's not happening. Something wrong with my browser settings :(
Any help Keith ..

Thanks
Priyank

-Original Message-
From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 4:39 PM
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


Hey,
This is a mistake I made at first too.  One would assume that a reset button
would call the reset method, but this is not the case.  The reset method is
called when an action is forwarding to a JSP with a form/form bean.  It's
mainly used to set the boolean properties associated with a checkbox to
false, so that they are correctly updated.  (Checkboxes kinda suck like
that).  The reset button is used differently.  It only gets rid of changes
made since you last submitted the form, meaning that it changes the fields
back to what they were when you arrived at the form.  The method and button
are two completely different things.  Does that make sense to you?
I hope this helps.

~ Keith
http://www.buffalo.edu/~kkamholz



-Original Message-
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 4:33 PM
To: 'Struts Users Mailing List'
Subject: Reset button does not invoke the FormBean's reset()


Hi All,
 I am not able to invoke FromBean's reset() method from the browser.
I have a form with two buttons Submit and Reset. When I click the 
reset button I am not able to invoke the reset() of the FormBean.
Any help will be great.
Thanks
Priyank

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



RE: Reset button does not invoke the FormBean's reset()

2002-07-31 Thread James Mitchell

What scope did you define for this formbean?

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 4:50 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Yeah I figured that out. But my problem is little tricky.
 I have a set of radio buttons and when I select them , the
 selected values automatically get set in a String[]. Now,
 when I try to reset the values back to the original state
 i.e. all radio buttons unselected , I just reset the String[]
 back to the original state in the reset method. When I click the
 reset button I should see all radio radio buttons getting unselected
 but it's not happening. Something wrong with my browser settings :(
 Any help Keith ..

 Thanks
 Priyank

 -Original Message-
 From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 4:39 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hey,
 This is a mistake I made at first too.  One would assume that a
 reset button
 would call the reset method, but this is not the case.  The reset
 method is
 called when an action is forwarding to a JSP with a form/form bean.  It's
 mainly used to set the boolean properties associated with a checkbox to
 false, so that they are correctly updated.  (Checkboxes kinda suck like
 that).  The reset button is used differently.  It only gets rid of changes
 made since you last submitted the form, meaning that it changes the fields
 back to what they were when you arrived at the form.  The method
 and button
 are two completely different things.  Does that make sense to you?
 I hope this helps.

 ~ Keith
 http://www.buffalo.edu/~kkamholz



 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 4:33 PM
 To: 'Struts Users Mailing List'
 Subject: Reset button does not invoke the FormBean's reset()


 Hi All,
  I am not able to invoke FromBean's reset() method from the browser.
 I have a form with two buttons Submit and Reset. When I click the
 reset button I am not able to invoke the reset() of the FormBean.
 Any help will be great.
 Thanks
 Priyank

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



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




RE: Reset button does not invoke the FormBean's reset()

2002-07-31 Thread Gupta, Priyank x57787

I need the bean in Session scope , so that 
when the user returns to the same page using
the back button he should see the radio buttons
selected. He should not lose the selections.Only
when he presses the reset button the radio buttons
should clear.Any ideas , how to do it ???
Thanks
Priyank

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 5:09 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


What scope did you define for this formbean?

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 4:50 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Yeah I figured that out. But my problem is little tricky.
 I have a set of radio buttons and when I select them , the
 selected values automatically get set in a String[]. Now,
 when I try to reset the values back to the original state
 i.e. all radio buttons unselected , I just reset the String[]
 back to the original state in the reset method. When I click the
 reset button I should see all radio radio buttons getting unselected
 but it's not happening. Something wrong with my browser settings :(
 Any help Keith ..

 Thanks
 Priyank

 -Original Message-
 From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 4:39 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 Hey,
 This is a mistake I made at first too.  One would assume that a
 reset button
 would call the reset method, but this is not the case.  The reset
 method is
 called when an action is forwarding to a JSP with a form/form bean.  It's
 mainly used to set the boolean properties associated with a checkbox to
 false, so that they are correctly updated.  (Checkboxes kinda suck like
 that).  The reset button is used differently.  It only gets rid of changes
 made since you last submitted the form, meaning that it changes the fields
 back to what they were when you arrived at the form.  The method
 and button
 are two completely different things.  Does that make sense to you?
 I hope this helps.

 ~ Keith
 http://www.buffalo.edu/~kkamholz



 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 4:33 PM
 To: 'Struts Users Mailing List'
 Subject: Reset button does not invoke the FormBean's reset()


 Hi All,
  I am not able to invoke FromBean's reset() method from the browser.
 I have a form with two buttons Submit and Reset. When I click the
 reset button I am not able to invoke the reset() of the FormBean.
 Any help will be great.
 Thanks
 Priyank

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



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



RE: Reset button does not invoke the FormBean's reset()

2002-07-31 Thread James Mitchell

Ok, first of all,  its probably not a good idea to have.. 'when the user
hits the back button it should...' in any of your use casesbut since we
all deal the cards we are dealt, lets deal with this.

The user hitting the back button has nothing to do with the scope of your
bean.
When the user hits back, the page is pulled from memory on the users pc (or
from disk, depending on which browser and version)

If the user then hits the reset button, the form should clear back to
original values.

This reminds me about a debate I had with PHBs over the difference between
resetting the form and clearing the form.  They lost of course.

Anyway, hope that helps you a little.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:13 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I need the bean in Session scope , so that
 when the user returns to the same page using
 the back button he should see the radio buttons
 selected. He should not lose the selections.Only
 when he presses the reset button the radio buttons
 should clear.Any ideas , how to do it ???
 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:09 PM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 What scope did you define for this formbean?

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://www.open-tools.org/struts-atlanta




  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:50 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Yeah I figured that out. But my problem is little tricky.
  I have a set of radio buttons and when I select them , the
  selected values automatically get set in a String[]. Now,
  when I try to reset the values back to the original state
  i.e. all radio buttons unselected , I just reset the String[]
  back to the original state in the reset method. When I click the
  reset button I should see all radio radio buttons getting unselected
  but it's not happening. Something wrong with my browser settings :(
  Any help Keith ..
 
  Thanks
  Priyank
 
  -Original Message-
  From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:39 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Hey,
  This is a mistake I made at first too.  One would assume that a
  reset button
  would call the reset method, but this is not the case.  The reset
  method is
  called when an action is forwarding to a JSP with a form/form
 bean.  It's
  mainly used to set the boolean properties associated with a checkbox to
  false, so that they are correctly updated.  (Checkboxes kinda suck like
  that).  The reset button is used differently.  It only gets rid
 of changes
  made since you last submitted the form, meaning that it changes
 the fields
  back to what they were when you arrived at the form.  The method
  and button
  are two completely different things.  Does that make sense to you?
  I hope this helps.
 
  ~ Keith
  http://www.buffalo.edu/~kkamholz
 
 
 
  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:33 PM
  To: 'Struts Users Mailing List'
  Subject: Reset button does not invoke the FormBean's reset()
 
 
  Hi All,
   I am not able to invoke FromBean's reset() method from the browser.
  I have a form with two buttons Submit and Reset. When I click the
  reset button I am not able to invoke the reset() of the FormBean.
  Any help will be great.
  Thanks
  Priyank
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 


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



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




RE: Reset button does not invoke the FormBean's reset()

2002-07-31 Thread Gupta, Priyank x57787

I am not sure what are you talking about.
Anyway, if you have a suggestion please 
let me know. What I explained you wasn't
clear I guess.I press the reset button and 
the radio buttons don't get cleared. Any
ideas ?(only one this time) 
Thanks
Priyank

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 5:46 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Ok, first of all,  its probably not a good idea to have.. 'when the user
hits the back button it should...' in any of your use casesbut since we
all deal the cards we are dealt, lets deal with this.

The user hitting the back button has nothing to do with the scope of your
bean.
When the user hits back, the page is pulled from memory on the users pc (or
from disk, depending on which browser and version)

If the user then hits the reset button, the form should clear back to
original values.

This reminds me about a debate I had with PHBs over the difference between
resetting the form and clearing the form.  They lost of course.

Anyway, hope that helps you a little.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:13 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Reset button does not invoke the FormBean's reset()


 I need the bean in Session scope , so that
 when the user returns to the same page using
 the back button he should see the radio buttons
 selected. He should not lose the selections.Only
 when he presses the reset button the radio buttons
 should clear.Any ideas , how to do it ???
 Thanks
 Priyank

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 31, 2002 5:09 PM
 To: Struts Users Mailing List
 Subject: RE: Reset button does not invoke the FormBean's reset()


 What scope did you define for this formbean?

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://www.open-tools.org/struts-atlanta




  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:50 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Yeah I figured that out. But my problem is little tricky.
  I have a set of radio buttons and when I select them , the
  selected values automatically get set in a String[]. Now,
  when I try to reset the values back to the original state
  i.e. all radio buttons unselected , I just reset the String[]
  back to the original state in the reset method. When I click the
  reset button I should see all radio radio buttons getting unselected
  but it's not happening. Something wrong with my browser settings :(
  Any help Keith ..
 
  Thanks
  Priyank
 
  -Original Message-
  From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:39 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Reset button does not invoke the FormBean's reset()
 
 
  Hey,
  This is a mistake I made at first too.  One would assume that a
  reset button
  would call the reset method, but this is not the case.  The reset
  method is
  called when an action is forwarding to a JSP with a form/form
 bean.  It's
  mainly used to set the boolean properties associated with a checkbox to
  false, so that they are correctly updated.  (Checkboxes kinda suck like
  that).  The reset button is used differently.  It only gets rid
 of changes
  made since you last submitted the form, meaning that it changes
 the fields
  back to what they were when you arrived at the form.  The method
  and button
  are two completely different things.  Does that make sense to you?
  I hope this helps.
 
  ~ Keith
  http://www.buffalo.edu/~kkamholz
 
 
 
  -Original Message-
  From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 31, 2002 4:33 PM
  To: 'Struts Users Mailing List'
  Subject: Reset button does not invoke the FormBean's reset()
 
 
  Hi All,
   I am not able to invoke FromBean's reset() method from the browser.
  I have a form with two buttons Submit and Reset. When I click the
  reset button I am not able to invoke the reset() of the FormBean.
  Any help will be great.
  Thanks
  Priyank
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 


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



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



Applying struts submit and reset button tags functionality to images

2002-05-15 Thread Yaman Kumar

Hi,
Can any one help in applying struts submit /reset buttons
to images.

html:submitsubmit/html:submit

html:submitreset/html:submit

To

img src=bean:write name=ctxtPath//images/submit.gif width=42
height=22 border=0

img src=bean:write name=ctxtPath//images/reset.gif width=42
height=22 border=0

Many Thanks,
rayaku




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




RE: Applying struts submit and reset button tags functionality to images

2002-05-15 Thread Leonardo Maciel

use html:img tag

-Original Message-
From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:26 AM
To: Struts Users Mailing List
Subject: Applying struts submit and reset button tags functionality to
images


Hi,
Can any one help in applying struts submit /reset buttons
to images.

html:submitsubmit/html:submit

html:submitreset/html:submit

To

img src=bean:write name=ctxtPath//images/submit.gif width=42
height=22 border=0

img src=bean:write name=ctxtPath//images/reset.gif width=42
height=22 border=0

Many Thanks,
rayaku




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

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




RE: Applying struts submit and reset button tags functionality to images

2002-05-15 Thread Robert Taylor

I think the html:image tag renders as input type=image .../ which is
what you need.
At least that is what I'm using in Struts 1.0.

robert

 -Original Message-
 From: Leonardo Maciel [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 15, 2002 9:28 AM
 To: Struts Users Mailing List
 Subject: RE: Applying struts submit and reset button tags functionality
 to images


 use html:img tag

 -Original Message-
 From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 15, 2001 9:26 AM
 To: Struts Users Mailing List
 Subject: Applying struts submit and reset button tags functionality to
 images


 Hi,
 Can any one help in applying struts submit /reset buttons
 to images.

 html:submitsubmit/html:submit

 html:submitreset/html:submit

 To

 img src=bean:write name=ctxtPath//images/submit.gif width=42
 height=22 border=0

 img src=bean:write name=ctxtPath//images/reset.gif width=42
 height=22 border=0

 Many Thanks,
 rayaku




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

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


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




RE: Applying struts submit and reset button tags functionality to images

2002-05-15 Thread Leonardo Maciel

you are right use html:image instead

from_working_code
...
   html:image property=login src=/images/butn_go_white_bg.gif
alt=login /
...
/from_working_code


-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 9:37 AM
To: Struts Users Mailing List
Subject: RE: Applying struts submit and reset button tags functionality
to images


I think the html:image tag renders as input type=image .../ which is
what you need.
At least that is what I'm using in Struts 1.0.

robert

 -Original Message-
 From: Leonardo Maciel [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 15, 2002 9:28 AM
 To: Struts Users Mailing List
 Subject: RE: Applying struts submit and reset button tags functionality
 to images


 use html:img tag

 -Original Message-
 From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 15, 2001 9:26 AM
 To: Struts Users Mailing List
 Subject: Applying struts submit and reset button tags functionality to
 images


 Hi,
 Can any one help in applying struts submit /reset buttons
 to images.

 html:submitsubmit/html:submit

 html:submitreset/html:submit

 To

 img src=bean:write name=ctxtPath//images/submit.gif width=42
 height=22 border=0

 img src=bean:write name=ctxtPath//images/reset.gif width=42
 height=22 border=0

 Many Thanks,
 rayaku




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

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


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

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




How to make reset button clear all fields

2001-08-30 Thread Kwang-Shi Shu

 I noticed the following behavior for RESET button in STRUTS framework:

The Reset button will clear all fields on the first try. After that, if
you encountered validation errors, it seems to remember what have been
so far. From that point on, the reset button only clears the new
input values. Case in point -- try the struts-example login.jsp and
you know what I am talking about.

  What should I do if I still want to clear all field contents. I tried to
use
another button declared as input type=reset and it is not working
either.

Shu, Kwang-shi  | Tel 732-460-7848
Village Networks, Inc.  | Fax 732-460-9851
246 Industrial Way West |
Eatontown, NJ 078724| email: [EMAIL PROTECTED]




RE: How to make reset button clear all fields

2001-08-30 Thread Assenza, Chris

One alternative is to write a JavaScript function that will clear all your
text fields. Bind the function to the onClick event of a generic HTML button
tag and you're set.  Note that this only affects what you see on the screen,
it's never touching the server.  If you were to hit your new reset
JavaScript-based button it'd look cleared; however, if you hit refresh your
values would be re-populated. :)  Regardless, this suggestion will simulate
an HTML reset button.

Chris

Christopher Assenza
Phone:  412.201.6026
Fax: 412.201.6060
Email:  [EMAIL PROTECTED]
ACCESSDATA
Moving Your Business from Point A to Point e.SM
http://www.accessdc.com/



-Original Message-
From: Kwang-Shi Shu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 12:33 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: How to make reset button clear all fields


 I noticed the following behavior for RESET button in STRUTS framework:

The Reset button will clear all fields on the first try. After that,
if
you encountered validation errors, it seems to remember what have been
so far. From that point on, the reset button only clears the new
input values. Case in point -- try the struts-example login.jsp
and
you know what I am talking about.

  What should I do if I still want to clear all field contents. I tried to
use
another button declared as input type=reset and it is not
working
either.

Shu, Kwang-shi  | Tel 732-460-7848
Village Networks, Inc.  | Fax 732-460-9851
246 Industrial Way West |
Eatontown, NJ 078724| email: [EMAIL PROTECTED]



RE: How to make reset button clear all fields

2001-08-30 Thread Kevin Hinners

The Reset button is working the way the HTML specification has it defined
just as you described. It only resets the fields that have changed since the
page was displayed. In order to work around this problem, I created a
ResetAction class that gets called when you click on the reset button. This
class either disposes of the FormBean or clears the attributes and posts
back to the form page. Hope this helps.

Kevin Hinners
Senior Technical Analyst

FedEx Services
350 Spectrum Loop
Colorado Springs, CO 80921
719-484-2303
[EMAIL PROTECTED]


-Original Message-
From: Kwang-Shi Shu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 10:33 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: How to make reset button clear all fields


 I noticed the following behavior for RESET button in STRUTS framework:

The Reset button will clear all fields on the first try. After that, if
you encountered validation errors, it seems to remember what have been
so far. From that point on, the reset button only clears the new
input values. Case in point -- try the struts-example login.jsp and
you know what I am talking about.

  What should I do if I still want to clear all field contents. I tried to
use
another button declared as input type=reset and it is not working
either.

Shu, Kwang-shi  | Tel 732-460-7848
Village Networks, Inc.  | Fax 732-460-9851
246 Industrial Way West |
Eatontown, NJ 078724| email: [EMAIL PROTECTED]




Re: How to make reset button clear all fields

2001-08-30 Thread Marcelo Stefanelli Santos


You can try another button (input type button) associated
with a method in your bean.
This method will reset your atributes in your bean i.e.
this.XXX=; (String case)
this.YYY=0; (int case)
...


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 30, 2001 01:33 PM
Subject: How to make reset button clear all fields


 I noticed the following behavior for RESET button in STRUTS framework:

 The Reset button will clear all fields on the first try. After that, if
 you encountered validation errors, it seems to remember what have been
 so far. From that point on, the reset button only clears the new
 input values. Case in point -- try the struts-example login.jsp and
 you know what I am talking about.

   What should I do if I still want to clear all field contents. I tried to
 use
 another button declared as input type=reset and it is not working
 either.

 Shu, Kwang-shi  | Tel 732-460-7848
 Village Networks, Inc.  | Fax 732-460-9851
 246 Industrial Way West |
 Eatontown, NJ 078724| email: [EMAIL PROTECTED]






REPOST: How to make Reset button a graphical button?

2001-03-23 Thread Shamdasani Nimmi-ANS004

Hi,

Is there a way to associate an image with the 'Reset' button?

Thanks.

-Nimmi




Re: REPOST: How to make Reset button a graphical button?

2001-03-23 Thread jbirchfield


You can use a touch of javascript...

script
funxtion resetForm() {
 document.form.reset();
}
/script

a href="javascript:resetForm()"img .../a

James Birchfield

Ironmax
maximizing your construction equipment assets
5 Corporate Center
9960 Corporate Campus Drive,
Suite 2000
Louisville, KY 40223


   
   
Shamdasani 
   
Nimmi-ANS004 To: "'[EMAIL PROTECTED]'" 
[EMAIL PROTECTED]  
ANS004@motorcc:   
   
ola.com Subject: REPOST: How to make Reset button 
a graphical button?
   
   
03/23/01   
   
11:43 AM   
   
Please 
   
respond to 
   
struts-user
   
   
   
   
   




Hi,

Is there a way to associate an image with the 'Reset' button?

Thanks.

-Nimmi








How to make Reset button a graphical button?

2001-03-22 Thread Shamdasani Nimmi-ANS004

Hi,

Is there a way to associate an image with the 'Reset' button?

Thanks.

-Nimmi