• 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: Esoteric issue with automatic property validation and validationFailedWithException()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Esoteric issue with automatic property validation and validationFailedWithException()


  • Subject: Re: Esoteric issue with automatic property validation and validationFailedWithException()
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 19 May 2017 16:52:12 +0000
  • Thread-topic: Esoteric issue with automatic property validation and validationFailedWithException()

Looking at the code, it looks like it should work.  WOKeyValueAssociation.setValue() does the validation and calls that method.  Is it calling it on a different component than in the first example?

 

Chuck

 

From: Webobjects-dev <webobjects-dev-bounces+chill=email@hidden> on behalf of Paul Hoadley <email@hidden>
Date: Friday, May 19, 2017 at 3:52 AM
To: WebObjects-Dev <email@hidden>
Subject: Esoteric issue with automatic property validation and validationFailedWithException()

 

Hello,

 

Let’s say I have a Page component. On this page is a subcomponent, MyText, that looks like this in Page’s template:

 

<wo:MyText value="$item.content" />

 

And then MyText itself is just this:

 

<wo:text value="$^value"></wo:text>

 

Item.content is a String, and allowsNull is N in the model. So, obviously, it’s a candidate for automatic EOF property validation on form submission. When I leave the textarea blank and submit, validationFailedWithException() is called on the page—great.

 

But that’s not quite what MyText looks like—say I need to do other things with the bound string. So it actually looks like this:

 

<wo:text value="$value"></wo:text>

 

and has a couple of accessor methods instead:

 

    public String value() {

    return stringValueForBinding("value");

    }

 

    public void setValue(String value) {

    setValueForBinding(value, "value");

    }

 

Now, when I submit a blank textarea, validationFailedWithException() is _not_ called on the page. What’s going on here? What have I stomped on? How do I trigger automatic property validation with a component like this?

 

 

-- 
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/

 

 

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Esoteric issue with automatic property validation and validationFailedWithException()
      • From: Paul Hoadley <email@hidden>
References: 
 >Esoteric issue with automatic property validation and validationFailedWithException() (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: Abandoning AjaxDatePicker for JQuery?
  • Next by Date: Re: Improved exception page
  • Previous by thread: Esoteric issue with automatic property validation and validationFailedWithException()
  • Next by thread: Re: Esoteric issue with automatic property validation and validationFailedWithException()
  • Index(es):
    • Date
    • Thread