Re: SubComponents activate Validation at the first time

"WebObjects" <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Thank you Jerry for answering,

after checking what you said, indeed the validation is triggerd by passing the data from the FORM to the EOCustomObjects
and not by passing to subcomponents.

I have a FORM which presents an Customer. By creating a new Customer and displaying the Customer Page the attributes like
customer.name etc... activating the validation.

OK, I think this is correct now.

Well, what is the solution?

After creating a new object like
Customer  customer = new Customer();
i add it to the editingContext before i change any values. However, chaning this doesnt turn off the validation.

Thank you in advance.


  ----- Original Message ----- 
  From: Jerry W. Walker 
  To: WebObjects 
  Cc: [email protected] 
  Sent: Monday, February 27, 2006 9:50 PM
  Subject: Re: SubComponents activate Validation at the first time


  Hi, Sako,


  The validation methods should not be triggered by passing data to a subcomponent, whether you pass that data by setting the subcomponent's iVars from Main, whether you use takeValueForKey or whether you set up and use the bindings in WOBuilder for the subcomponent.


  Validation should only be occurring if you are explicitly messaging one of the validation methods for one of your EOCustomObjects, or you are implicitly activating them by triggering an save somehow.


  Regards,
  Jerry


  On Feb 27, 2006, at 10:21 AM, WebObjects wrote:


    Hello,

    I am using Components, something like: 
    ----------------------------------------------------
    Main
        SubCompoent
            Texts, strings, etc...
        End SubCompoent
    End Main
    ----------------------------------------------------

    The problem I have: The user opens the page to the first time. 
    By passing the data from the Main to SubComponent The validation is executed because of setXXXX methods "i guess".
    The method validationFailedWithException passes a message like "Name" is not allowed to be null. This happens by displaying the Page at the first time.

    It is correct because the "Name" is still NULL of couarse, but this is because the user didnt have the ability to put any data.

    However, anybody has an idea, what do i miss or make wrong? thank you.

    Sako.
    _______________________________________________
    WebObjects-dev mailing list
    [email protected]
    http://www.omnigroup.com/mailman/listinfo/webobjects-dev




  --
  __ Jerry W. Walker,
     WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


      [email protected]
      203 278-4085        office

_______________________________________________
WebObjects-dev mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.