Rip's Domain

IsValid(): the missing validation

Posted in ColdFusion by rip747 on July 26, 2007

The thing that always bothered with IsValid() is that you can’t validate an object as a certain type. Currently all you can do is see ifa variables is an object is call the IsObject() function and it will return true if the variable is an object and false if it isn’t. But suppose that you wanted to make sure that not only is the variable an object but a certain object. Suppose that you needed to make sure that the variable is a certain bean like “model.beans.UserBean”. Currently you can’t do: IsValid(“object”, myobj, “model.beans.UserBean”). Could be a nice little addition to CF8.

5 Responses

Subscribe to comments with RSS.

  1. Derek P. said, on July 26, 2007 at 7:13 pm

    I believe you can do with with the new isInstanceOf() method.

  2. Brian Kotek said, on July 26, 2007 at 10:50 pm

    Yes, IsInstanceOf() already does this.

  3. rip747 said, on July 26, 2007 at 11:42 pm

    kewl!!!!

    I’m late getting into all the new stuff that CF8 has to offer.

  4. Joshua Mostafa said, on July 27, 2007 at 12:04 am

    That was lame even in the 90s. No one writes “kewl” any more.

  5. rip747 said, on July 27, 2007 at 12:13 am

    I’ve been stuck in the 90s for the last 17 years😛


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: