• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ValidateValueForKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ValidateValueForKey


  • Subject: Re: ValidateValueForKey
  • From: Sam Barnum <email@hidden>
  • Date: Wed, 18 Feb 2004 11:54:49 -0700

One possibility is, the value is not being set when you think it is, because the value you want to set it to is equal to the current value of the object. If that is the case, most items will not bother to set the value, and your validation method won't be called.

This comes in handy for cases where you have a custom accessor which returns a default value, but you don't want to save that to the database.

e.g.

public String getUsername() {
     String username = (String)storedValueForKey("username");
    if (username == null) return "[unknown]";
    else return username;
}

If someone submits a form with the [unknown] value for username, the setUsername() method isn't called, since it is equal to the current value for username.

You might be experiencing something totally different, however.


On Tuesday, February 17, 2004, at 06:09 AM, Shantanu Wadodkar wrote:

HI

I have below method in my WOComponent, which it is not printing the SOP?
Can any one help me in understanding the same?


Even if I change the signature to
	    public Object validateValueForKey(Object aValue, String key)
throws NSValidation.ValidationException
it is not printing my SOP?

public class BaseComponent extends WOComponent {

   public Object validateValueForKey(Object aValue, String key) {
        System.out.println("\n\n\n\n Base Component Print");
        return super.validateValueForKey(aValue, key);
    }
}

-Thanks
Shantanu

Phone:20-6113187, 6111613/4
Fax: 20-6113198
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >ValidateValueForKey (From: "Shantanu Wadodkar" <email@hidden>)

  • Prev by Date: Re: advanced EOF: batch fetching relationship: can't fetch certain relationships
  • Next by Date: Re: solved: advanced EOF: batch fetching relationship: can't fetch certain relationships
  • Previous by thread: ValidateValueForKey
  • Next by thread: Event Lisner I Presume - Triggering Code
  • Index(es):
    • Date
    • Thread