Conditionally Validating an Entire Form Based Upon the button pressed
I have a form which has a save (html:submit ...) and continue (html:cancel ...) button. The save should validate and process the data in the form. The continue button should go to the next page, skipping any validation and processing. I have been using the validator plugin, with all of my validation in the validation.xml file. My form bean extends ValidatorForm and my validate function is commented out (is not overriding the parent). This validates great but will not allow me to skip validation on continue. I have searched Google for conditional validation and only found how to conditionally validate required fields based upon the values of other fields. Any ideas or suggestions? Thanks. Robert
RE: Conditionally Validating an Entire Form Based Upon the buttonpressed
I just tried this method and it works for me. Thanks! I may study the other suggestions as time permits. Thanks everyone for your suggestions! Robert [EMAIL PROTECTED] 8/19/2004 2:30:18 PM -Original Message- From: Robert Miller [mailto:[EMAIL PROTECTED] Sent: Thursday, August 19, 2004 12:25 PM To: [EMAIL PROTECTED] Subject: Conditionally Validating an Entire Form Based Upon the buttonpressed I have a form which has a save (html:submit ...) and continue (html:cancel ...) button. The save should validate and process the data in the form. The continue button should go to the next page, skipping any validation and processing. I have been using the validator plugin, with all of my validation in the validation.xml file. My form bean extends ValidatorForm and my validate function is commented out (is not overriding the parent). This validates great but will not allow me to skip validation on continue. I have searched Google for conditional validation and only found how to conditionally validate required fields based upon the values of other fields. Any ideas or suggestions? Yes, go ahead and override the validate method, checking which button was pressed, and then call super.validate() as usual. The framework does have a page component, so the validataion will only validate the pages submitted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help on Validator MASK needed
Thomas, I agree with the escaping + (without escaping it is interpreted as must have one or more of the previous). Also if you wanted you could use \d instead of [0-9]. A modified version that looks good is: ^(\+|-)?\d+$ This will match x or +x or -x (where x is any series of one or more digits, the number of digits have no upper limit). Your original design would also have matched + or - without digits following. To fix this the last * needed to be changed to a +. Allowing digits only without a proceeding + or - was something I added. That can be removed by taking out the ? in the regular expression I gave. Hope this helps. Robert [EMAIL PROTECTED] 7/30/2004 8:10:14 AM have you tried escaping the + and -? [\+\-] -Original Message- From: Thomas Vogt [mailto:[EMAIL PROTECTED] Sent: Friday, July 30, 2004 8:10 AM To: [EMAIL PROTECTED] Subject: Help on Validator MASK needed Hi, I would appreciate some help, My DynaValidator Form doesn't get validated, I need a signed value (the field is an Integer). But the Mask doesn't seem to get the meaning in the plus or minus in front. Thats why whenever the form gets validated i get the mask error. Below is my actual validation.xml, but I tried combinations like : [+-]{1} or [+-]{1} or [+-]{1} too field property=liquiditaetsaenderung depends=required, mask msg name=mask key=error.mask.liquiditaetsaenderung.entscheidung/ arg0 key=error.field.liquiditaetsaenderung.entscheidung/ varvar-namemask/var-namevar-value^+|-[0-9]*$/var-value/var /field Anyone with an idea on how to solve this problem ?? Thanks Thomas Message sent using UebiMiau 2.7.8 - 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: Why does html:submit work differently than html:link action=?
Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Why does html:submit work differently than html:link action=?
Andy, I don't have an answer but what I would try first is examining those values on the client. First do a view source on your generated HTML and make sure your values are there. Next in your Javascript after you've set any values but before you submit your form (which should be last anyway) use an alert command (Example: alert(my value = + form.field.value); ). Hope this helps. Robert [EMAIL PROTECTED] 7/28/2004 11:09:37 AM hi Robert, yes i've tried using javascript, but i must be doing something wrong. i've tried two approaches. 1) i was calling a javascript function that set the action for me and then submited the form. but the values inside my hidden fields weren't getting picked up. 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) andy On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller [EMAIL PROTECTED] wrote: Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - 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: Not Logged in with the same loggin-password if it is already registered.
How do you handle the situation where the user closes the browser without logging out (the windows X is not always our friend ;) ). I am not familiar with the SessionListener. Would it help in some way? Robert [EMAIL PROTECTED] 7/28/2004 3:25:16 PM Exactly! Or use HttpSessionlistener and database solution (that jim outlined) simultaneously.. (We are doing almost this except as a solution to a kind of opposite problem - when a user logs off we need to do soem work so.. this seems to work nicely) -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow Sent: Wednesday, July 28, 2004 4:28 PM To: [EMAIL PROTECTED] Subject: Re: Not Logged in with the same loggin-password if it is already registered. Maybe you could have a hashtable in the ServletContext that maps loginId to HttpSession -- then use a HttpSessionListener to listen for session creation -- when the session is created look for a value in the hashmap in the servlet context -- if it is there then invalidate the mapped session. Then add (put) the new mapping into the hashatable. Ricardo Andres Quintero wrote: Hello Guys I need not to let users to login in my app simultaneosly. I mean if a login-password is actually logged in, i need to invalidatye that session and then let the new login-password to work in, after invalidating the old session. Any ideas? and of course any examples? -- Ricardo Andrés Quintero R. Ubiquando Ltda. - 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]
Validation prevents Action from creating session scope object
I have a Struts application that acts like a wizard (conditionally displaying only relevant pages and skipping others based upon previous user input). One of my pages collects multiple instances of a single record by allowing data to be entered and displaying previous records in a table. To accomplish this my Action class queries the contents of the bean, which is my model, to determine if the JSP it supports should be displayed. If the JSP should be displayed, the Action creates necessary objects (an ArrayList) setting them in the session (under the name of list) and forwards to the use mapping. Otherwise the Action class forwards to the skip mapping, bypassing this page. The JSP uses the logic:iterate tags to display the contents of list from the session in a table. When I hit the Add button on the page, the Action (the same Action mentioned above, it handles both pre and post processing for the page) takes my form bean and adds it to the ArrayList and returns to the page where another entry is shown in the list of records. My problem is, when I tried to add validation all that I have described broke. The browser displays Error 500: Cannot find bean list in any scope. It is acting as though validation is bypassing my action (and my initialization code) and going directly to the page. Is this possible? Do I have something configured wrong? I have other pages that do not rely on preexisting classes in the session and they are validating without problems. Thank you for your help.Robert
RE: Validation prevents Action from creating session scope object
Thanks for the information. I have been trying to keep my validation in one place (validation.xml). Is it possible to have a page that validates through XML be entered (and initialized) through an Action? And if so how? Thanks, Robert [EMAIL PROTECTED] 7/26/2004 12:43:17 PM -Original Message- From: Robert Miller [mailto:[EMAIL PROTECTED] Sent: Monday, July 26, 2004 10:36 AM To: [EMAIL PROTECTED] Subject: Validation prevents Action from creating session scope object snip The browser displays Error 500: Cannot find bean list in any scope. It is acting as though validation is bypassing my action (and my initialization code) and going directly to the page. Is this possible? Do I have something configured wrong? I have other Validation happens before the action is called, so yes it is possible. You can control validation through the action mapping in struts-config.xml, or you can play with the validation method on the form bean. pages that do not rely on preexisting classes in the session and they are validating without problems. Thank you for your help.Robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation prevents Action from creating session scopeobject
Wow. That looks promising. Thank you again for all of your help. Robert [EMAIL PROTECTED] 7/26/2004 12:59:21 PM -Original Message- From: Robert Miller [mailto:[EMAIL PROTECTED] Sent: Monday, July 26, 2004 10:50 AM To: [EMAIL PROTECTED] Subject: RE: Validation prevents Action from creating session scopeobject Thanks for the information. I have been trying to keep my validation in one place (validation.xml). Is it possible to have a page that validates through XML be entered (and initialized) through an Action? And if so how? action path=/showDaPage type=package.path.to.Action name=ActionForm input=/whereItCameFrom.do validate=false forward name=success path=page.jsp/forward /action action path=/mungDaPage type=package.path.to.Action name=ActionForm input=/showDaPage.do validate=true forward name=success path=daPageWotMungedGood.jsp/forward /action Note, that the type= is not accidently the same thing. I don't know how you tell the action if it's setting up the page, or processing the page so can't help you there, but that's the gist of it. The key here is that this maps a URI to a java class that extends the Action class. There is no law ( well except for maybe the Law of Common Sense) against having more then one mapping to a single class. In fact the ForwardAction kind of depends on it. Thanks, Robert [EMAIL PROTECTED] 7/26/2004 12:43:17 PM -Original Message- From: Robert Miller [mailto:[EMAIL PROTECTED] Sent: Monday, July 26, 2004 10:36 AM To: [EMAIL PROTECTED] Subject: Validation prevents Action from creating session scope object snip The browser displays Error 500: Cannot find bean list in any scope. It is acting as though validation is bypassing my action (and my initialization code) and going directly to the page. Is this possible? Do I have something configured wrong? I have other Validation happens before the action is called, so yes it is possible. You can control validation through the action mapping in struts-config.xml, or you can play with the validation method on the form bean. pages that do not rely on preexisting classes in the session and they are validating without problems. Thank you for your help.Robert - 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: Recommendations for a JavaScript date picker
Here are a couple from sites that I have found useful. http://javascript.internet.com/calendars/date-picker.html http://www.dynamicdrive.com/dynamicindex6/popcalendar2.htm Hope they help. Robert [EMAIL PROTECTED] 7/26/2004 2:17:20 PM Any recommendations for a JavaScript date picker? I have taken a quick look at struts:layout but I do not need all that it has to offer nor the overhead. Integration into struts (and struts validation) would be beneficial, but not required. -- James THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.