DynaValidatorForm

2003-10-07 Thread Glenn Holmer
When you're using DynaValidatorForm and the page has two buttons
(e.g. "Commit" and "Cancel"), how do you not validate if the user
hits the "Cancel" button (which on my page, also submits, but the
action checks the value of the submit button)?
Do I have to write a Form subclass to do this?  Can you have a
hand-coded Form subclass and use the Validator rules as well?
--
________
Glenn Holmer  [EMAIL PROTECTED]
Programmer/Analyst   phone: 414.908.1809
Weyco Group, Inc.  fax: 414.908.1601
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidatorForm

2003-10-07 Thread Glenn Holmer
Adam Hardy wrote:
If your buttons have values set then you can test to see which button 
value was submitted. Even better though with struts you can use the 
built-in cancel button without needing to do that.  and 
then check action.isCancelled(request)
But those would be done in the action class, right?  I'm wondering
if this can be done using a DynaValidatorForm -- the Validator is
tossing me back to the input page before the action is invoked.
When you're using DynaValidatorForm and the page has two buttons
(e.g. "Commit" and "Cancel"), how do you not validate if the user
hits the "Cancel" button (which on my page, also submits, but the
action checks the value of the submit button)?
Do I have to write a Form subclass to do this?  Can you have a
hand-coded Form subclass and use the Validator rules as well?
--
________
Glenn Holmer  [EMAIL PROTECTED]
Programmer/Analyst   phone: 414.908.1809
Weyco Group, Inc.  fax: 414.908.1601
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidatorForm

2003-10-07 Thread Glenn Holmer
Frederic Dernbach wrote:
Glenn,

- Use a descendant of DispatchAction for your form's action,
- Have two separate methods in the action class for your two buttons
(one for 'commit' and one for 'cancel').
- In the struts-config.xml file, specify attribute 'validate' to 'false'
for your form's action.The form validation wont't happen automatically
this way.
- In the method for the 'commit' button, call explicitely 'validate' on
your form. But not in the method associated to the cancel button.
Thanks, I got that to work without resorting to a DispatchAction
like this:
if (confirm.equals(cancel)) {
  forward = "complete";
} else {
  errors = dynaForm.validate(mapping, request);
  if (errors.size() > 0) {
request.setAttribute("org.apache.struts.action.ERROR", errors);
forward = "failure";
  }
}
Is that the right way to put the errors in play?

--

Glenn Holmer  [EMAIL PROTECTED]
Programmer/Analyst   phone: 414.908.1809
Weyco Group, Inc.  fax: 414.908.1601
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidatorForm

2003-10-07 Thread Glenn Holmer
Adam Hardy wrote:
Why get complicated? All you need is  and the validation 
will automatically not be executed. Even the javascript validation if 
you are using DynaValidatorForm.
Now *that* is slick.  Thanks.

--

Glenn Holmer  [EMAIL PROTECTED]
Programmer/Analyst   phone: 414.908.1809
Weyco Group, Inc.  fax: 414.908.1601
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


value of html:button

2003-10-08 Thread Glenn Holmer
I'm having trouble retrieving the value of an html:button tag.
JSP looks like this:

  
  

  

and the Action:

disposition = (String)dynaForm.get("disposition");

My debugger tells me that disposition is an empty String when
I click the Delete button and respond OK to the JavaScript.
It's correct when I click the "Edit Task" button, and there are
no typos in struts-config.xml.
What am I doing wrong?

--
________
Glenn Holmer  [EMAIL PROTECTED]
Programmer/Analyst   phone: 414.908.1809
Weyco Group, Inc.  fax: 414.908.1601
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JavaServer Faces

2003-10-09 Thread Glenn Holmer
Matt Raible wrote:
It seems that a lot of
"Experts" are touting that it'll be easy to develop because it's a
*standard* and IDEs will support it.
http://wwws.sun.com/software/products/projectrave/

--
________
Glenn Holmer  [EMAIL PROTECTED]
Programmer/Analyst   phone: 414.908.1809
Weyco Group, Inc.  fax: 414.908.1601
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]