Re: [flexcoders] CSS usage?

2007-12-05 Thread Lex
This application of the CSS sheet, is only good at compile time?

The goal is to gain the ability to style the Flex application via CSS, allowing 
end users to do things like change background color, etc.



  - Original Message - 
  From: Gordon Smith 
  To: flexcoders@yahoogroups.com 
  Sent: Sunday, December 02, 2007 10:18 PM
  Subject: RE: [flexcoders] CSS usage?


   

  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  mx:Style source=mystyles.css/
  /mx:Application

  - Gordon


--
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Lex
  Sent: Sunday, December 02, 2007 3:44 PM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] CSS usage?


   

  Anyone?  The livedocs site is a pain to navigate :/

  Appreciated muchly!
  Alex




- Original Message - 
From: Lex 
To: flex 
Sent: Friday, November 30, 2007 3:45 PM
Subject: [flexcoders] CSS usage?


 

If I go here and build a CSS sheet:

http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#

Where do I instruct the system to use it thereafter?

Thanks.
Alex



   

Re: [flexcoders] Registering flashvar variables properly?

2007-12-02 Thread Lex
Hi Gordon,

Warnings are on, nothing displayed.  I'm using Flex 3 if that's of any 
relevance.  

In the same thread, yes I did mean to write earlier that modifying 
contactform.url inside of initapp solved the problem.  

Regards.
Alex


  - Original Message - 
  From: Gordon Smith 
  To: flexcoders@yahoogroups.com 
  Sent: Friday, November 30, 2007 7:11 PM
  Subject: RE: [flexcoders] Registering flashvar variables properly?



HTTPService.url isn't marked [Bindable]. 

  Alex, your code

  mx:HTTPService ...  url= {scrmurl}xmlrpc/request.php ... /

  should have generated a binding warning. Do you have them turned off?

  - Gordon



--
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Peter 
Farland
  Sent: Friday, November 30, 2007 3:26 PM
  To: flexcoders@yahoogroups.com
  Subject: RE: [flexcoders] Registering flashvar variables properly?



  Right, HTTPService.url isn't marked [Bindable]. Programmatically updating it 
as needed should work, as Tracy mentioned.



--
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Gordon Smith
  Sent: Friday, November 30, 2007 6:13 PM
  To: flexcoders@yahoogroups.com
  Subject: RE: [flexcoders] Registering flashvar variables properly?


   I had to finally resort to giving the HTTPService object an id

  The HTTPService object already had id=contactform.

   and adjusting that object's ID inside of the initialize block. 

  Do you mean adjusting the HTTPService's 'url' property?

  - Gordon



--
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Lex
  Sent: Friday, November 30, 2007 2:26 PM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] Registering flashvar variables properly?



  Whatever I tried, it just wouldn't work.

  I had to finally resort to giving the HTTPService object an id, and adjusting 
that object's ID inside of the initialize block.  Doing that, worked.  Setting 
the HTTPService url to the bindable var inside of the XML markup, was a no-go.




- Original Message - 
From: Tracy Spratt 
To: flexcoders@yahoogroups.com 
Sent: Friday, November 30, 2007 5:23 PM
Subject: RE: [flexcoders] Registering flashvar variables properly?



Oops, missed that, but of course, otherwise this[i] = would have errored, 
since Application is not dynamic.


Thanks' for the correction, Gordon, and never-mind, Alex.


So, Alex, this: url= {scrmurl}xmlrpc/request.php  should work.  How 
about when you do your send(), you verify scrmurl has the string in it?


You might also try a different style of binding/assignment:

url= {scrmurl + 'xmlrpc/request.php'}


Tracy






From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Gordon Smith
Sent: Friday, November 30, 2007 4:40 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Registering flashvar variables properly?


scrmurl isn't a dynamic property.. it's declared at compile time as a 
public var, and should be bindable. 


- Gordon





From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Tracy Spratt
Sent: Friday, November 30, 2007 12:23 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Registering flashvar variables properly?

You won't be able to {bind} to dynamically created properties easily.  
There may be a way to set up a binding using AS, not sure.  

You could just set the url directly in initApp().

Tracy




From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
flexnubslice
Sent: Friday, November 30, 2007 2:57 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Registering flashvar variables properly?

Hi,

   I'm busting my head against the wall on this one, I have to say that 
Flex is pretty frustrating when you otherwise code C++ or Java by trade.

   Poking around, I have found how to pass variables into Flex apps using 
flashvars.  If I check the Application.application.parameters value, they are 
all there.  So far so good.

   What I need to do, is pass a proxy URL from HTML, into Flex, that will 
be used as a url parameter for an HTTPService.

I have for example:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute height=380 width=450 alpha=1.0 
initialize=initApp();

mx:Script
![CDATA[

[Bindable]
public var scrmurl:String

Re: [flexcoders] CSS usage?

2007-12-02 Thread Lex
Anyone?  The livedocs site is a pain to navigate :/

Appreciated muchly!
Alex




  - Original Message - 
  From: Lex 
  To: flex 
  Sent: Friday, November 30, 2007 3:45 PM
  Subject: [flexcoders] CSS usage?


   

  If I go here and build a CSS sheet:
  
http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#

  Where do I instruct the system to use it thereafter?

  Thanks.
  Alex

   

Re: [flexcoders] Registering flashvar variables properly?

2007-11-30 Thread Lex
Whatever I tried, it just wouldn't work.

I had to finally resort to giving the HTTPService object an id, and adjusting 
that object's ID inside of the initialize block.  Doing that, worked.  Setting 
the HTTPService url to the bindable var inside of the XML markup, was a no-go.




  - Original Message - 
  From: Tracy Spratt 
  To: flexcoders@yahoogroups.com 
  Sent: Friday, November 30, 2007 5:23 PM
  Subject: RE: [flexcoders] Registering flashvar variables properly?



  Oops, missed that, but of course, otherwise this[i] = would have errored, 
since Application is not dynamic.



  Thanks' for the correction, Gordon, and never-mind, Alex.



  So, Alex, this: url= {scrmurl}xmlrpc/request.php  should work.  How about 
when you do your send(), you verify scrmurl has the string in it?



  You might also try a different style of binding/assignment:

  url= {scrmurl + 'xmlrpc/request.php'}



  Tracy






--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Gordon Smith
  Sent: Friday, November 30, 2007 4:40 PM
  To: flexcoders@yahoogroups.com
  Subject: RE: [flexcoders] Registering flashvar variables properly?



  scrmurl isn't a dynamic property.. it's declared at compile time as a public 
var, and should be bindable. 



  - Gordon




--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy 
Spratt
  Sent: Friday, November 30, 2007 12:23 PM
  To: flexcoders@yahoogroups.com
  Subject: RE: [flexcoders] Registering flashvar variables properly?

  You won't be able to {bind} to dynamically created properties easily.  There 
may be a way to set up a binding using AS, not sure.  

  You could just set the url directly in initApp().

  Tracy


--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
flexnubslice
  Sent: Friday, November 30, 2007 2:57 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Registering flashvar variables properly?

  Hi,

 I'm busting my head against the wall on this one, I have to say that Flex 
is pretty frustrating when you otherwise code C++ or Java by trade.

 Poking around, I have found how to pass variables into Flex apps using 
flashvars.  If I check the Application.application.parameters value, they are 
all there.  So far so good.

 What I need to do, is pass a proxy URL from HTML, into Flex, that will be 
used as a url parameter for an HTTPService.

  I have for example:

  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
  layout=absolute height=380 width=450 alpha=1.0 
initialize=initApp();

  mx:Script
  ![CDATA[

  [Bindable]
  public var scrmurl:String;

  private function initApp():void{
  var elements:Array = [ scrmurl ]; // there's quite a few of 
these..

  for( var i:String in elements ){
  if( Application.application.parameters[i] )   
 
  this[i] = Application.application.parameters[i];
  }
  }
  ]]
  /mx:Script

  mx:HTTPService
  contentType=application/x-www-form-urlencoded
  id=contactform
  method=POST
  resultFormat=e4x
  showBusyCursor=true
  url= {scrmurl}xmlrpc/request.php
  useProxy=false
  fault=handleFault( event )
  result=handleResult( event )
  /


  The idea is to pass in scrmurl, ie http://yourdomain.com/  and the URL in 
HTTPService then becomes:
  http://yourdomain.com/xmlrpc/request.php

  Why won't they HTTPService then, acknowledge the scrmurl variable?  When it 
posts, it only posts to xmlrpc/request.php, as though the parameter is being 
completely ignored..

  Thanks!
  Alex



   

Re: [flexcoders] Arrays, iteration, and referencing local variables?

2007-11-30 Thread Lex
Got it with:

private function initApp():void{

var elements:Array = [ 

scrmurl, form_title, form_email, form_subject,

form_message, form_submit, category, confirmText, 

wait, success_title, success 

];



for( var i:String in elements ){ 

if( Application.application.parameters[i] ) 

this[i] = Application.application.parameters[i];

} 



}





  - Original Message - 
  From: flexnubslice 
  To: flexcoders@yahoogroups.com 
  Sent: Friday, November 30, 2007 3:36 AM
  Subject: [flexcoders] Arrays, iteration, and referencing local variables?


  I'm trying to do something like this, but am unsure of the proper
  language constructs in Flex:

  var a:String = ;
  var b:String = ;
  var c:String = ;

  private function initApp():void{
  var elements:Array = [ a, b, c ];

  for( var i:String in elements ){
  if( Application.application.parameters.i )
  this.i = Application.application.parameters.i;
  }
  }

  Just trying to init some vars if they were set, but not sure how to
  reference the this.i part..

  Thanks!
  Alex



   

[flexcoders] CSS usage?

2007-11-30 Thread Lex
If I go here and build a CSS sheet:
http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#

Where do I instruct the system to use it thereafter?

Thanks.
Alex

Re: [flexcoders] Tracing HTTPService Data?

2007-11-28 Thread Lex
Thanks for the response.

So there's no built-in debugging service available?  Seems odd that we have no 
means to capture HTTP request responses inside of Flex.

Re: [flexcoders] Re: Tracing HTTPService Data?

2007-11-28 Thread Lex
Hi Simon,

This info seems to contradict what others have offered in this same thread. 
 Where precisely would I add this directive?

Thanks.
Alex


  - Original Message - 
  From: simonjpalmer 
  To: flexcoders@yahoogroups.com 
  Sent: Wednesday, November 28, 2007 2:42 PM
  Subject: [flexcoders] Re: Tracing HTTPService Data?


  You can get at the contents of the messages using mx:TraceTarget on
  the client, which will spit a whole load of stuff to your console in
  debug mode. 

  I don't use an http service, but I know that on the server you can
  alter the level of logging by adjusting the contents of the logging
  tag in services-config.xml.

  hth
  Simon 

  --- In flexcoders@yahoogroups.com, flexnubslice [EMAIL PROTECTED] wrote:
  
   Hi there,
   
   Thanks in advance for your help. I'm a newcomer to Flex, but am
   definitely not new to Eclipse being a Java programmer by trade.
   
   I've set up a basic HTTPService as introductory project, and quickly
   found that I can add breakpoints into fault and result events. What I
   cannot find though, is how to trace the data that the HTTP portal is
   feeding the Flex app. Is there a means to debug the actual request
  data?
   
   Thanks.
   Alex
  



   

Re: [flexcoders] Re: Can validation prevent text input entry?

2007-03-22 Thread Lex
I managed a workaround with the following itemEditor (that is accepting e4x 
data):

?xml version=1.0 encoding=utf-8?
mx:TextInput xmlns:mx=http://www.adobe.com/2006/mxml; 
implements=mx.core.IFactory
updateComplete=dataChanged() change=dataChanged()
mx:Script
![CDATA[
import mx.events.DataGridEvent;
import mx.validators.ValidationResult;
import mx.controls.dataGridClasses.DataGridColumn;
import flash.events.EventDispatcher;

public var dataField:String;


[Bindable]private var contentValue:String;

private function dataChanged():void{
contentValue = this.text;
super.data[dataField] = this.text;
}

public function newInstance():*{
return new GenericDollarFormatItemEditor();
}

override public function set data(value:Object):void {
if( value != null ){
super.data = value; 

if( !(value is DataGridColumn)  dataField != null ){ 
contentValue = value[dataField];
this.text = value[dataField];
} 
}
}

]]
/mx:Script
mx:CurrencyValidator id=cv source={this} property=text 
alignSymbol=left trigger={this} triggerEvent=change required=true/ 
/mx:TextInput









  - Original Message - 
  From: Alex Harui 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, March 22, 2007 1:55 AM
  Subject: RE: [flexcoders] Re: Can validation prevent text input entry?



  You could call a dataIsValid method on each itemEditorInstance.  Just know 
that the editor gets destroyed later and isn't around forever.




--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Lex
  Sent: Wednesday, March 21, 2007 7:47 PM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] Re: Can validation prevent text input entry?



  Thanks for the message Alex, however, is there no way to have the itemEditor 
handle this innately?  It'd be a cleaner solution than a huge itemEditEnd block 
inside of the datagrid container's mxml that needs to handle the various types 
of editors that the grid will contain.













- Original Message - 

From: Alex Harui 

To: flexcoders@yahoogroups.com 

Sent: Wednesday, March 21, 2007 2:09 PM

Subject: RE: [flexcoders] Re: Can validation prevent text input entry?



ITEM_EDIT_END is dispatched from DataGrid

mx:DataGrid id=dg itemEditEnd=itemEditEndHandler(event) /

private function itemEditEndHandler(event):void

{

  if (!dataIsValid(dg.itemEditorInstance.text))

event.preventDefault();

}




From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex
Sent: Wednesday, March 21, 2007 7:52 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Can validation prevent text input entry?

Anyone?

--- In flexcoders@yahoogroups.com, Lex [EMAIL PROTECTED] wrote:

 Thanks for the response! Precisely how does one listen for
ITEM_EDIT_END? (extremely new to flex)
 
 If I do 
 mx:TextInput textInput=validateData(event)
 
 with a
 
 
 
 private function validateData( event:TextEvent ):void{
 
 
 
 }
 
 
 where my validator has ID cv, how do I trigger validation, and then
check the result, to finally call event.preventDefault() if the shit
hits the fan?
 
 
 Thanks for your help. The docs in this dept are incredibly lacking..
 
 Alex
 
 
 
 
 - Original Message - 
 From: Alex Harui 
 To: flexcoders@yahoogroups.com 
 Sent: Wednesday, March 21, 2007 1:12 AM
 Subject: RE: [flexcoders] Can validation prevent text input entry?
 
 
 
 No, validation is not blocking. It is just that the itemEditor is
going away. What most folks do is check validation on ITEM_EDIT_END
and prevent the change to the dataprovider by calling
preventDefault(). You can also catch ITEM_EDIT_BEGINNING and return
the editor to the bad cell if the user is tabbing or clicking another
cell, but if the user clicks outside you can't really restore focus to
the cell.
 
 
 
 If you want to get really fancy then your itemRenderers will color
differently if they are invalid.
 
 
 
 -Alex
 
 
 
 

--
 
 From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Lex
 Sent: Tuesday, March 20, 2007 9:59 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Can validation prevent text input entry?
 
 
 
 Hi there,
 
 
 
 I have a TextInput type that I am using as an itemEditor in a
DataGrid. I'm trying to prevent users from entering anything but
'dollar' amounts. I have the class below, but it doesn't work as
expected... I can edit the grid cell, enter a letter, and then exit

Re: [flexcoders] Re: Can validation prevent text input entry?

2007-03-21 Thread Lex
Thanks for the message Alex, however, is there no way to have the itemEditor 
handle this innately?  It'd be a cleaner solution than a huge itemEditEnd block 
inside of the datagrid container's mxml that needs to handle the various types 
of editors that the grid will contain.






  - Original Message - 
  From: Alex Harui 
  To: flexcoders@yahoogroups.com 
  Sent: Wednesday, March 21, 2007 2:09 PM
  Subject: RE: [flexcoders] Re: Can validation prevent text input entry?



  ITEM_EDIT_END is dispatched from DataGrid





  mx:DataGrid id=dg itemEditEnd=itemEditEndHandler(event) /



  private function itemEditEndHandler(event):void

  {

if (!dataIsValid(dg.itemEditorInstance.text))

  event.preventDefault();

  }




--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex
  Sent: Wednesday, March 21, 2007 7:52 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Re: Can validation prevent text input entry?



  Anyone?

  --- In flexcoders@yahoogroups.com, Lex [EMAIL PROTECTED] wrote:
  
   Thanks for the response! Precisely how does one listen for
  ITEM_EDIT_END? (extremely new to flex)
   
   If I do 
   mx:TextInput textInput=validateData(event)
   
   with a
   
   
   
   private function validateData( event:TextEvent ):void{
   
   
   
   }
   
   
   where my validator has ID cv, how do I trigger validation, and then
  check the result, to finally call event.preventDefault() if the shit
  hits the fan?
   
   
   Thanks for your help. The docs in this dept are incredibly lacking..
   
   Alex
   
   
   
   
   - Original Message - 
   From: Alex Harui 
   To: flexcoders@yahoogroups.com 
   Sent: Wednesday, March 21, 2007 1:12 AM
   Subject: RE: [flexcoders] Can validation prevent text input entry?
   
   
   
   No, validation is not blocking. It is just that the itemEditor is
  going away. What most folks do is check validation on ITEM_EDIT_END
  and prevent the change to the dataprovider by calling
  preventDefault(). You can also catch ITEM_EDIT_BEGINNING and return
  the editor to the bad cell if the user is tabbing or clicking another
  cell, but if the user clicks outside you can't really restore focus to
  the cell.
   
   
   
   If you want to get really fancy then your itemRenderers will color
  differently if they are invalid.
   
   
   
   -Alex
   
   
   
   
  
  --
   
   From: flexcoders@yahoogroups.com
  [mailto:[EMAIL PROTECTED] On Behalf Of Lex
   Sent: Tuesday, March 20, 2007 9:59 PM
   To: flexcoders@yahoogroups.com
   Subject: [flexcoders] Can validation prevent text input entry?
   
   
   
   Hi there,
   
   
   
   I have a TextInput type that I am using as an itemEditor in a
  DataGrid. I'm trying to prevent users from entering anything but
  'dollar' amounts. I have the class below, but it doesn't work as
  expected... I can edit the grid cell, enter a letter, and then exit
  the grid without warning. It's only when I click on the grid to edit
  it a second time, that the red halo with the 'invalid input' flag
  appears. Help appreciated.
   
   
   
   
   
   ?xml version=1.0 encoding=utf-8?
   
   mx:TextInput
   
   focusOut=validateData();
  xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100%
  implements=mx.core.IFactory 
   
   mx:Script 
   
   ![CDATA[
   
   import mx.events.ValidationResultEvent; 
   
   import mx.controls.dataGridClasses.DataGridColumn; 
   
   
   
   public var dataField:String; 
   
   private var rowData:Object; 
   
   
   
   [
   
   Bindable]private var contentValue:String; 
   
   
   
   
   
   public function newInstance():*{ 
   
   return new GenericDollarFormatItemEditor(); 
   
   }
   
   
   
   private function validateData():void{ 
   
   cv.validate();
   
   }
   
   
   
   override public function set data(value:Object):void { 
   
   if( value != null ){ 
   
   rowData = value; 
   
   
   
   if( !(value is DataGridColumn)  dataField != null ){ 
   
   contentValue = value[dataField];
   
   this.text = value[dataField]; 
   
   } 
   
   }
   
   }
   
   
   
   ]]
   
   /mx:Script 
   
   mx:CurrencyValidator id=cv source={this} listener={this}
  property=text alignSymbol=left / 
   
   /mx:TextInput
  



   

[flexcoders] Can validation prevent text input entry?

2007-03-20 Thread Lex
Hi there,

I have a TextInput type that I am using as an itemEditor in a DataGrid.  
I'm trying to prevent users from entering anything but 'dollar' amounts.  I 
have the class below, but it doesn't work as expected...  I can edit the grid 
cell, enter a letter, and then exit the grid without warning.  It's only when I 
click on the grid to edit it a second time, that the red halo with the 'invalid 
input' flag appears.  Help appreciated.


?xml version=1.0 encoding=utf-8?
mx:TextInput focusOut=validateData(); 
xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% 
implements=mx.core.IFactory
mx:Script
![CDATA[
import mx.events.ValidationResultEvent;
import mx.controls.dataGridClasses.DataGridColumn;

public var dataField:String;
private var rowData:Object;

[Bindable]private var contentValue:String;


public function newInstance():*{
return new GenericDollarFormatItemEditor();
}

private function validateData():void{
cv.validate();
}

override public function set data(value:Object):void {
if( value != null ){
rowData = value; 

if( !(value is DataGridColumn)  dataField != null ){ 
contentValue = value[dataField];
this.text = value[dataField];
} 
}
}

]]
/mx:Script
mx:CurrencyValidator id=cv source={this} listener={this} property=text 
alignSymbol=left /
/mx:TextInput

Re: [flexcoders] Can validation prevent text input entry?

2007-03-20 Thread Lex
Thanks for the response!  Precisely how does one listen for ITEM_EDIT_END? 
(extremely new to flex)

If I do 
mx:TextInput textInput=validateData(event)

with a



private function validateData( event:TextEvent ):void{



}


where my validator has ID cv, how do I trigger validation, and then check the 
result, to finally call event.preventDefault() if the shit hits the fan?


Thanks for your help.  The docs in this dept are incredibly lacking..

Alex




  - Original Message - 
  From: Alex Harui 
  To: flexcoders@yahoogroups.com 
  Sent: Wednesday, March 21, 2007 1:12 AM
  Subject: RE: [flexcoders] Can validation prevent text input entry?



  No, validation is not blocking.  It is just that the itemEditor is going 
away.  What most folks do is check validation on ITEM_EDIT_END and prevent the 
change to the dataprovider by calling preventDefault().  You can also catch 
ITEM_EDIT_BEGINNING and return the editor to the bad cell if the user is 
tabbing or clicking another cell, but if the user clicks outside you can't 
really restore focus to the cell.



  If you want to get really fancy then your itemRenderers will color 
differently if they are invalid.



  -Alex




--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Lex
  Sent: Tuesday, March 20, 2007 9:59 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Can validation prevent text input entry?



  Hi there,



  I have a TextInput type that I am using as an itemEditor in a DataGrid.  
I'm trying to prevent users from entering anything but 'dollar' amounts.  I 
have the class below, but it doesn't work as expected...  I can edit the grid 
cell, enter a letter, and then exit the grid without warning.  It's only when I 
click on the grid to edit it a second time, that the red halo with the 'invalid 
input' flag appears.  Help appreciated.





  ?xml version=1.0 encoding=utf-8?

  mx:TextInput

  focusOut=validateData(); xmlns:mx=http://www.adobe.com/2006/mxml; 
width=100% height=100% implements=mx.core.IFactory 

  mx:Script 

  ![CDATA[

  import mx.events.ValidationResultEvent; 

  import mx.controls.dataGridClasses.DataGridColumn; 



  public var dataField:String; 

  private var rowData:Object; 



  [

  Bindable]private var contentValue:String; 





  public function newInstance():*{ 

  return new GenericDollarFormatItemEditor(); 

  }



  private function validateData():void{ 

  cv.validate();

  }



  override public function set data(value:Object):void { 

  if( value != null ){ 

  rowData = value; 



  if( !(value is DataGridColumn)  dataField != null ){ 

  contentValue = value[dataField];

  this.text = value[dataField]; 

  } 

  }

  }



  ]]

  /mx:Script 

  mx:CurrencyValidator id=cv source={this} listener={this} 
property=text alignSymbol=left / 

  /mx:TextInput


   

[flexcoders] DataGrid, CurrencyValidator, and e4x

2007-03-14 Thread Lex
Hi,

Any examples anywhere, on adding a CurrencyValidator to a DataGridColumn 
that contains e4x data?

Regards.
Alex

Re: [flexcoders] Re: Regexp wont work cause of the b labels

2007-03-14 Thread Lex
This book is a must-own:

http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124/ref=pd_bbs_sr_1/002-1529781-6061612?ie=UTF8s=booksqid=1173895819sr=8-1

GL!
Alex

  - Original Message - 
  From: tonyx_788 
  To: flexcoders@yahoogroups.com 
  Sent: Wednesday, March 14, 2007 1:51 PM
  Subject: [flexcoders] Re: Regexp wont work cause of the b labels


  Thank you very much, im new in regexp is there any web or tutorial to
  learn more about it?

  THX

  --- In flexcoders@yahoogroups.com, Paul DeCoursey [EMAIL PROTECTED] wrote:
  
   no, not at all what I am saying. You can try this...
   
   new RegExp(^(.*)? + inputText.text,i\*)
   
   This should ignore any html tag at the beginning if it exists. I am
   not an expert at regular expressions so this might fail some test cases.
   
   --- In flexcoders@yahoogroups.com, tonyx_788 tonyx_788@ wrote:
   
are you saying there is no way to start a filter search after the b
tag? without typing it first


--- In flexcoders@yahoogroups.com, Paul DeCoursey paul@ wrote:

 --- In flexcoders@yahoogroups.com, tonyx_788 tonyx_788@ wrote:
 
  Hi all i'm looking for a regular expression for mi app
  
  im using CDATA inside my XML so when i try to make a filter
   search it
  wont work cause of the B or i before the text
  
  lets say in my xml i have something like this:
  name![CDATA[bAcademia./b]]/name
  it dont work if i type academia but
  if i put bAcademia it works
  
  this is what im using to make the filter search
  
  private function filter(item:Object):Boolean
  {
  return item.name.match(new RegExp(^ + inputText.text,i\*));
  }
  
 
 ^ searches from the beginning of the string, so of course it will
 not find it since b is the beginning of your string.
 
  Thanks
 

   
  



   

Re: [flexcoders] DataGrid! mx:Validator in a mx:DataGrid, and Annoying Enter key behavior?

2007-03-14 Thread Lex
Thanks Alex, I'll run with this.


  - Original Message - 
  From: Alex Harui 
  To: flexcoders@yahoogroups.com 
  Sent: Wednesday, March 14, 2007 5:18 PM
  Subject: RE: [flexcoders] DataGrid! mx:Validator in a mx:DataGrid, and 
Annoying Enter key behavior?



  You will probably have to get the Enter key event by listening for it in 
capture phase and calling stopImmediatePropagation.



  You might be able to do it by watching for ITEM_EDIT_BEGINNING and intercept 
where it wants to move the editor.




--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Lex
  Sent: Tuesday, March 13, 2007 3:11 PM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] DataGrid! mx:Validator in a mx:DataGrid, and 
Annoying Enter key behavior?



  I did find this, that's good:

  
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Partsfile=celleditor_073_17.html



  Still pending on the enter key business.



  A.



- Original Message - 

From: Lex 

To: flexcoders@yahoogroups.com 

Sent: Tuesday, March 13, 2007 6:05 PM

Subject: [flexcoders] DataGrid! mx:Validator in a mx:DataGrid, and Annoying 
Enter key behavior?



Hi.



I'm looking to validate some input!  How precisely do I go about 
connecting a Validator, perhaps a CurrencyValidator, to a datagridcolumn?  The 
example at http://livedocs.adobe.com/flex/201/langref/index.html is not cluing 
me in.. _





Also, when I click in a DataGrid square, the cell goes into Edit mode, 
this is fantastic.  Intuitively, when I'm done, I hit the 'Enter' key.  This 
does complete the edit, unfortunately, it also opens up an editor on the cell 
directly below the current - this is a behavior I'd like to stop.  How can I 
override the 'Enter' key behavior on the datagrid, such that it just stops 
editing the current cell?



Thanks as always.

Alex







   

Re: [flexcoders] Need help with validation in a DataGrid

2007-03-13 Thread Lex
Nobody knows? :(  Should be straightforward to all the Flexmasters out there! :)


  - Original Message - 
  From: Lex 
  To: flexcoders@yahoogroups.com 
  Sent: Tuesday, March 13, 2007 7:09 PM
  Subject: [flexcoders] Need help with validation in a DataGrid



  I'm having a hard time putting a CurrencyValidator inside of a DataGrid.  The 
breakpoints would indicate that the data binds properly, but I get an 
unfortunately XML mess with big scrollbars in the datagrid instead of what I'd 
expect.

  Here's the GenericDollarFormatItemRenderer.mxml that intuition built:


--

  ?xml version=1.0 encoding=utf-8?
  mx:HBox
  xmlns:mx=http://www.adobe.com/2006/mxml; 

  mx:Script 
  ![CDATA[
  import mx.controls.dataGridClasses.DataGridColumn; 

  public var dataField:String; 

  [
  Bindable] 
  private var dataString:String; 

  public function newInstance():* 
  {
  return new GenericDollarFormatItemRenderer(); 
  }

  override public function set data(value:Object):void { 

  if( value != null ){ 
  super.data = value; 

  if( !(value is DataGridColumn)  dataField != null  value[dataField] != 
null ){ 
  dataString = value[dataField];
  obj:Object;
  }
  }
  }
  ]]
  /mx:Script 

  mx:CurrencyValidator id=pnV source={ti} property=text 
  trigger=
  {ti} triggerEvent=change required=true / 
  mx:TextInput id=ti text={dataString} 
updateComplete=dataString=ti.text; change=dataString=ti.text;/ 
  /mx:HBox

--



  I'm adding it to my DataGrid as follows:



--
  [Bindable] private var cf1:ClassFactory = new ClassFactory( 
GenericDollarFormatItemRenderer );
  ...

  cf1.properties = { dataField: 'price' };

  ...

  mx:DataGridColumn headerText=price textAlign=right editable=true 
itemRenderer={cf1} /



--


  The data source for the data grid is e4x XML drawn from an HTTPService.

  Any experts out there can elucidate this one?


  Thanks
  Alex