RE: Issues when reusing a DynaValidatorForm

2004-01-16 Thread Richard Hightower
about your earlier message ok i did misunderstand


okay



did you know bean:message not only takes a key but the trinity of
attributes...

i define the trininty of attributes as name, property, scope


thus,




the above would call simpleForm.getWidgetDescription(), which would return a
key into the resouce bundle. just prep the form before you got to the page
by going to an action that loads the form page.


As far as validation goes.

Hm.

Did you know that validation is not keyed off of the form name
(name="fooForm"), but off of the attribute (attribute="fooForm")? (I found
out the hard way).

You could use two action mappings, one for one type of message, one for the
other type of message by messages I mean form labels. Then you would need to
entries for the form in the validation.xml file as well.




-Original Message-
From: Janice [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 11:40 AM
To: [EMAIL PROTECTED]
Subject: Issues when reusing a DynaValidatorForm


Thanks Richard, but I think mayhaps I didn't explain myself very well the
first time, because I'm not sure that a mapped backed property will do it
for me.  That or I just don't understand what a mapped backed property is :)

I want a "name" property on all of the forms that are using my
DynaValidatorForm, but I want the text next to the field to read something
different.  So its the  that I want to
change from page to page.  So far simply having distinct .jsps is working,
but I'd like to reduce the duplicated code.

The validator is the other part of the problem... so far its looking like
this:

  

  
  .
But I want the key to be page specific.

Thanks,
Janice


-
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: Issues when reusing a DynaValidatorForm

2004-01-16 Thread Richard Hightower
I think you want a mapped backed property.

Here is an example:

 
 
 
 
 
 
 
 
 
 
 
 
 
<---SEE THIS

  
See dynamicProps above.

You can access the dynamic field like so:

  

  Dyna Prop Bar


  

  
  

  Dyna Prop Foo


  

  



Here is the full JSP form for the above:



  

  *


  

  

  *


  

  

  *


  

  
  

  *


  

  
  

  


  

  
  

  


  

  
  

  *


  

  
  

  *


  

  

  

  *


  

  
  

  *


  

  
  

  Dyna Prop Bar


  

  
  

  Dyna Prop Foo


  

  

  

  

  


  

  




Rick Hightower
Developer

Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm

Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring

-Original Message-
From: Janice [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 10:03 AM
To: [EMAIL PROTECTED]
Subject: Issues when reusing a DynaValidatorForm


I have a simple DynaValidatorForm (just 3 items: name, description, action)
that is reused
for several forms.

The issue that I'm having is that the names of the form elements might be
different from one form to the next.  For example, on one page the 'name'
might be called 'Project Code' and on another page it might be 'widget Short
Name' and so on.  So far I'm writing out distinct .jsp pages for each form,
because I can't seem to get around having to do:  and .

Is there a way to pass in some variable to the bean tag so that I can define
the variable once such as:
?  So far I haven't found anything
that works.

Also, when I am using validation on my form, is there anything I can do to
get the page-specific text to appear in my error messages?  I bet someone's
going to complain if I use a really generic description of name and
description.

Thanks in advance,
Janice


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