aspose file tools*
The moose likes JDBC and the fly likes Property= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Property="*" and null form fields" Watch "Property="*" and null form fields" New topic
Author

Property="*" and null form fields

David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
If I'm using the property-"*" functionality and the user doesn't enter anything into the form field.
What I'm seeing is that the appropriate "set" method doesn't get fired, so no validation can be performed on that field.
Any way around this?
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
Why not set a strange default value in the bean and test for it's not having changed.
example:
private String firstname = kkksss ;
validation method(){
....
if( firstname.equals( "kkksss" )
errMessage += "You haven't filled in your name!" ;
....
}
Hope that helps,

------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
Using Property="*" is causing me a real pain...
What EXACTLY is the relationship between the form field names, the public variables the get/set property names?
If I make the form fields all lower case, nothing gets fired, others I have to make them upper and lower (firstName fires, but firstname doesn't), likewise faqid fires the FaqID() method.
Is there some consistent way to figure this out?
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
I'm not 100% on this but the convention is for variable names to start with a lowercase letter eg. 'var'. and then joined words get capital letters eg. 'varWithCapitals'
get/set methods capitalize the first letter of the variables so the get/set for the above examples would be getVar(), setVar() and getVarWithCapitals() and setVarWithCapitals() respectively.
As far as I know, all beans follow this rule so if you are using someone elses bean you'll have to follow suit.
Correct me if I'm wrong anybody....
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
I'm having issues with that convention, however, I had a field on a form named:
Form Field: faqID
Property name: faqID
Get/Set: FAQID()
Never fired get/set. Only when I set the following did it work properly:
Form Field: faqid
Property name: faqid
Get/Set: Faqid()
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Property="*" and null form fields