[flexcoders] Problems with using mx:Validator tag in MXML and code-behind approach in Flex 2

2006-08-31 Thread Andriy Panas
Hello flexcoders,

 I am using code-behind approach 
(http://www.adobe.com/devnet/flex/quickstart/building_components_using_code_behind/)
and my mx:Validator tag is declared in MXML.

  During compiling, I receive a warning Data binding will not be able
  to detect assignments to username. Thus, my binding to 'source' property in
mx:Validator does not work!

My MXML:

1)
-
?xml version=1.0 encoding=utf-8?
local:ValidationFormBase 
xmlns:mx=http://www.adobe.com/2006/mxml; 
xmlns:local=* 
   
mx:Validator required=true id=_messageTextRequireValidator 
source={username} property=text
/

mx:TextInput left=85 right=10 top=10 id=username/
/local:ValidationFormBase
-

My code-behind AS3 'ValidationFormBase.as' class:
2)
-
package
{
import mx.core.Application;
import mx.controls.TextInput;

public class ValidationFormBase extends Application
{
public var username : TextInput;

public function ValidationFormBase()
{

super();
}

}
}
---

 If I use Validator class in AS3 for validation, everything works
fine, but I simply want to declare mx:Validator tag in MXML, it is
sooo much convenient.

 We are using code-behind approach 
(http://www.adobe.com/devnet/flex/quickstart/building_components_using_code_behind/)
  for 1 year already for all our code and we do not want to resign
  from this approach. All developers in our company strongly believe
  that *ANY* AS3 code should be separated from the MXML markup.


-- 
Best regards,
 Andriy  mailto:[EMAIL PROTECTED]



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] Problems with using mx:Validator tag in MXML and code-behind approach in Flex 2

2006-08-31 Thread Andriy Panas
Hello all,

During compiling, I receive a warning Data binding will not be able to 
detect assignments to username. Thus, my binding to 'source' property in 
mx:Validator does not work!

  I had figured out my error, I should use [Bindable] directive in my AS3 class 
with every variable that got binded in MXML, like this:

[Bindable]
public var username : TextInput;


--
Andriy



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/