It’s because you’re probably not using binding to setup the relationship between the contactVO and the form fields.  All you need to do is on your validators set the listener property to be the TextInput that is the source.

 

Matt

 


From: James Ward [mailto:[EMAIL PROTECTED]
Sent: Friday, January 28, 2005 2:42 PM
To: [email protected]
Subject: [flexcoders] Validator + ValueObject

 

Has anyone ever tried to use the Validator with a ValueObject instead of
a Model object?  I am trying it, but instead of my form fields getting
red borders when validation fails, I get pop-ups.  :(

Here is some of my code:

import valueobjects.*;

var contactVO : ContactVO;

function initApp() : Void
{
  contactVO = new ContactVO();
}

function nextPage() : Void
{
  loadContactVO();

  if (mx.validators.Validator.isStructureValid(this,'contactVO'))
  {
    // flip to the second accordian
    information.selectedIndex= 1;
  }
}


<mx:Validator field="contactVO.name"/>
<mx:EmailValidator field="contactVO.email"/>
<mx:PhoneNumberValidator field="contactVO.phone"/>


If I add in a Model object then it will work, but I hate having to
maintain my value objects in 3 places.

BTW: The reason why I am using a Value Object is because it seems that I
have to in order to pass a VO to my RemoteObject.

Thanks in advance.

-James



Reply via email to