2 Replies Latest reply on Jul 27, 2010 8:11 AM by Anthony.R

    Compile Error when accessing Validator Group

    Anthony.R Level 2

      I've been running into an odd problem lately when it comes to compiling my application.  In some cases I get the following error:

       

      Error: Access of possibly undefined property customerNameValidator through a reference with static type com.xxx.customer.CustomerValidators

       

      Here is the Validation Subscriber that is defined in my MXML view:

       

      <validation:ValidatorSubscriber validator="{model.customer.selectedCustomer.validatorGroup.customerNameValidator}"

      listener="{customerName}"/>

       

      And here is the actual validator MXML:

       

      <validators:ValidatorGroup

      xmlns:mx="http://www.adobe.com/2006/mxml"

      xmlns:validators="com.adobe.cairngorm.validation.*">

       

      <mx:Script>

      <![CDATA[

       

      [Bindable]

      public var model:CustomerDetail

      ]]>

      </mx:Script>

       

      <validators:validators>


      <mx:StringValidator id="customerNameValidator"

      required="true"

      source="{model}"

      property="Name"

      triggerEvent="propertyChange"/>

       

       

      </validators:validators>

       

      </validators:ValidatorGroup>

       

      Based on the error it appears as though the compiler is not seeing the StringValidator with id customerNameValidator as a public property of the validator group.  The odd part is that this code does compile fine in certain cases.  I can compile through Flex Builder and ANT fine on my MacOS development machine but when the same ANT script gets executed by my Windows Hudson CI server the error occurs.  Turning off strict type checking also fixes the problem.

       

      I don't think this is a Cairngorm issue but thought I'd post here to see if anyone else had come across it while using the Cairngorm validators.