[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-03 Thread Florian
Hi Alex, i coded a short example.

http://www.box.net/shared/knmjmazcvv

The zip file contains 3 files: HelloWorld.mxml (the application), 
MyComponent.as and MySkin.mxml. If you remove the comment in line 42 in 
MySkin.mxml, you'll notice that the measuring is done correctly, as far as i 
understand. Whereas the code without the additional invalidation call leads to 
missing calculations of the positioning.

What i don't understand: which values should i expect when dealing with groups 
and why does the result differ.

Best regards.

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 I may not be understanding your issue.  I'm pretty sure our 
 SkinnableContainers delegate their assigned layouts to the contentGroup 
 because the contentGroup's measurements affect the size given to it by its 
 parent and the eventual call to updateDisplayList.  If you subclass 
 updateDisplayList in the SkinnableComponent I don't see how the assigned 
 layout will know that its measurement is not right.
 
 One way to encapsulate the measurement and layout logic together is to create 
 a custom layout.  I suppose you could also just override measure() in the 
 component as well.
 
 
 On 5/31/10 12:34 AM, Florian florian.saliho...@... wrote:
 
 
 
 
 
 
 Hi Alex, usually i would agree right on spot but the fact that i am using a 
 basic layout in for group and the layouting is done correctly, i don't really 
 see the need for another class. There is just one update of the measuring 
 missing, which i don't understand.
 
 When a Group is using a BasicLayout contentWidth and contentHeight should be 
 equal with width and height, if clipping is not enabled and no values for 
 width or height are set explicitly. Or am i mistaken in this point?
 
 Best regards and thanks for taking the time.
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
 Alex Harui aharui@ wrote:
 
  I would create a new Layout class and properly measure and layout in its 
  measure() and updateDisplayList() methods and use that as the 
  contentGroup's layout, otherwise the Group's default layout class is going 
  to be arguing with your code.
 
 
  On 5/30/10 3:36 AM, Florian florian.salihovic@ wrote:
 
 
 
 
 
 
  Hi,
 
  i was and i am still running into problems with sizing and placing 
  components in skins programmatically for spark ActionScript and 
  MXML/ActionScript components.
 
  I want to initialize the components in MXML and size and position the 
  children in the component's (a component's skin) updateDisplayList, 
  although this might be a bit of an uncommon approach.
 
  I was implementing the positioning via UIComponent.move, which i realized 
  was the wrong approach. After just setting the x and y properties, i did 
  some research and stumbled across the ILayoutElement and its methods like 
  setLayoutBoundsPosition and corresponding methods to modify the skin's 
  display list. But somehow the group, which contains the children, does not 
  propagate its new size up to its parent. I use the updateComplete event to 
  invalidate the group's size and force the layout to be calculated properly 
  a last time. The view looks as expected. But i don't think that 
  invalidating a component a last time after an updateComplete event was 
  dispatched is wrong.
 
  Now, what is the right approach for the following task: implementing a 
  skinnable component and a corresponding skin. The skin creates the skin 
  parts in MXML in a Group (id=contentGroup) but the layout is calculated 
  within the skin's updateDisplayList method.
 
  I only found one useful article on the web, which is not really a lot of 
  information at all 
  (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
 
  Best regards.
 
 
 
 
 
 
  --
  Alex Harui
  Flex SDK Team
  Adobe System, Inc.
  http://blogs.adobe.com/aharui
 
 
 
 
 
 
 
 --
 Alex Harui
 Flex SDK Team
 Adobe System, Inc.
 http://blogs.adobe.com/aharui





[flexcoders] How to upload a file with FileReference ?? Any help please :( :(

2010-06-03 Thread Nini7016 Nini7016

Hello 

In my application, i have to upload a local file and send it to a server.

There is my code : 

   private const FILE_UPLOAD_URL:String = 
http://www.YOUR-WEBSITE-HERE.com/fileref/uploader.cfm;;
 
   private function init():void 
{
fileRef = new FileReference();
var textTypes:FileFilter = new FileFilter(WSDL file, 
*.pdf ; *.wsdl);
xmlTypes= new Array(textTypes);


//the upload
fileRef.addEventListener(Event.SELECT, fileRef_select);
fileRef.addEventListener(Event.COMPLETE, fileRef_complete);

}

   mx:Button label=Upload file id=btn_upload click=browseAndUpload();  
x=384 y=59 enabled=true/
  
private function browseAndUpload():void 
{

 
 fileRef.browse(xmlTypes);
 
 
  
}

private function fileRef_select(evt:Event):void {
try {
fileRef.upload(new URLRequest(FILE_UPLOAD_URL));
 //fileRef.load 
//fileRef.save();
//display the name of the file in the AreaText
forChange.text = fileRef.name;

//fill in the file in the List
myCB.dataProvider = fileRef.name;

} catch (err:Error) {
//message.text = ERROR: zero-byte file;
Alert.show(ERROR to upload the file);
}
}

When i add fileRef.load in the code that provides ERROR :( :( 
However i don't understand what should i put in the variable  FILE_UPLOAD_URL ??

Any idea please :( 

Thanks for your help 

;)

  
_
La boîte mail NOW Génération vous permet de réunir toutes vos boîtes mail dans 
Hotmail !
http://www.windowslive.fr/hotmail/nowgeneration/

Re: [flexcoders] How to upload a file with FileReference ?? Any help please :( :(

2010-06-03 Thread claudiu ursica
I might be reading this the wrong way but in FILE_UPLOAD_ URL you should put 
the path to the server script that will save your file on the server.
C






From: Nini7016 Nini7016 nahloulaha...@hotmail.com
To: flexcoders@yahoogroups.com
Sent: Thu, June 3, 2010 10:29:17 AM
Subject: [flexcoders] How to upload a file with FileReference ?? Any help 
please :( :(

   
Hello 

In my application, i have to upload a local file and send it to a server.

There is my code : 

   private const FILE_UPLOAD_ URL:String = http://www. 
YOUR-WEBSITE- HERE.com/ fileref/uploader .cfm;
 
   private function init():void 
{
fileRef = new FileReference( );
var textTypes:FileFilte r = new FileFilter( WSDL file, 
*.pdf ; *.wsdl);
xmlTypes= new Array(textTypes) ;


//the upload
fileRef.addEventLis tener(Event. SELECT,fileRef_select);
fileRef.addEventLis tener(Event. COMPLETE, 
fileRef_complete) ;

}

   mx:Button label=Upload file id=btn_upload click=browseAndUpload();  
x=384 y=59 enabled=true /
  
private function browseAndUpload():void 
{

 
 fileRef.browse(xmlTypes);
 
 
  
}

private function fileRef_select(evt:Event): void {
try {
fileRef.upload( new URLRequest(FILE_ UPLOAD_URL) );
 //  fileRef.load 
//fileRef.save( );
//display the name of the file in the AreaText
forChange.text = fileRef.name;

//fill in the file in the List
myCB.dataProvider = fileRef.name;

} catch (err:Error) {
//message.text = ERROR: zero-byte file;
Alert.show( ERROR to upload the file);
}
}

When i add fileRef.load in the code that provides ERROR :( :( 
However i don't understand what should i put in the variable FILE_UPLOAD_ URL ??

Any idea please :( 

Thanks for your help 

;)




Votre vie privée l'est-elle vraiment ? Internet Explorer 8 vous protège 
gratuitement ! 
 


  

RE: [flexcoders] How to upload a file with FileReference ?? Any help please :( :(

2010-06-03 Thread Nini7016 Nini7016

First of all, thank you very very much to answer me :)

So, here i must create a class Java which uplod the file ?? isn't it ??



To: flexcoders@yahoogroups.com
From: the_bran...@yahoo.com
Date: Thu, 3 Jun 2010 01:59:51 -0700
Subject: Re: [flexcoders] How to upload a file with FileReference ?? Any help 
please :( :(


















 



  



  
  
  
I might be reading this the wrong way but in FILE_UPLOAD_ URL you should put 
the path to the server script that will save your file on the server.
C


From: Nini7016 Nini7016 nahloulaha...@hotmail.com
To: flexcoders@yahoogroups.com
Sent: Thu, June 3, 2010 10:29:17 AM
Subject: [flexcoders] How to upload a file with FileReference ?? Any help 
please :( :(









 




  
  
  


Hello 

In my application, i have to upload a local file and send it to a server.

There is my code : 

   private const FILE_UPLOAD_ URL:String = http://www. 
YOUR-WEBSITE- HERE.com/ fileref/uploader .cfm;
 
   private function init():void 
{
fileRef = new FileReference( );
var textTypes:FileFilte r =
 new FileFilter( WSDL file, *.pdf ; *.wsdl);
xmlTypes= new Array(textTypes) ;


//the upload
fileRef.addEventLis tener(Event. SELECT, fileRef_select);
fileRef.addEventLis tener(Event. COMPLETE, 
fileRef_complete) ;

}

   mx:Button label=Upload file id=btn_upload click=browseAndUpload();  
x=384 y=59 enabled=true /
  
private function browseAndUpload():void 
{

 
 fileRef.browse(xmlTypes);
 
 
   
   
}

private function fileRef_select(evt:Event): void {
try {
fileRef.upload( new URLRequest(FILE_ UPLOAD_URL) );
 //fileRef.load 
//fileRef.save(
 );
//display the name of the file in the AreaText
forChange.text = fileRef.name;

//fill in the file in the List
myCB.dataProvider = fileRef.name;

} catch (err:Error) {
//message.text = ERROR: zero-byte
 file;
Alert.show( ERROR to upload the file);
}
}

When i add fileRef.load in the code that provides ERROR :( :( 
However i don't understand what should i put in the variable  FILE_UPLOAD_ URL 
??

Any idea please :( 

Thanks for your help 

;)

  

Votre vie privée l'est-elle vraiment ? Internet Explorer 8 vous protège 
gratuitement !




 








  



 









  
_
Hotmail arrive sur votre téléphone ! Compatible Iphone, Windows Phone, 
Blackberry, …
http://www.messengersurvotremobile.com/?d=Hotmail

Re: [flexcoders] Blocking

2010-06-03 Thread Oleg Sivokon
You can load it with JavaScript synchronously, ExternalInterface is also
synchronous, however, it is possible that you will run out of time and the
application will crash because of that. Because, even though you can
try-catch timeout error, if the function that produced the error won't exit,
you will get another error that you cannot try-catch.


[flexcoders] Re: Binding checkbox item renderer with XMLList item

2010-06-03 Thread Amy
In answer to question 3, check out the comments here 
http://livedocs.adobe.com/flex/3/html/help.html?content=celleditor_4.html to 
see how to fix CheckBox so it works properly as a DropInListItemRenderer.

--- In flexcoders@yahoogroups.com, Asif Nawaz aasif...@... wrote:

 Let we have following data in xml form.
 
 employees
    employee   name Smith /name   age 25 /age   isselected true 
 /isselected   /employee
    employee   name John /name   age 28 /age   isselected true 
 /isselected   /employee
 
    employee   name Roger /name   age 30 /age   isselected false 
 /isselected   /employee
 
    employee   name Andy /name   age 20 /age   isselected false 
 /isselected   /employee
 
    employee   name Kim /name   age 18 /age   isselected false 
 /isselected   /employee
 /employees
 
 1 - How do i create XMLList from this xml at design time in action script.2- 
 Use this XMLList object as data provider of datagrid.3- How to bind 
 isselected item of xml with checkbox. 





[flexcoders] flex SSL facebook graph api and IE

2010-06-03 Thread fotis.chatzinikos
Hello all ...

Anybody playing with Facebook's new graph api?

I have an application that uses:

https://graph.facebook.com/me?access_token=...token here...

To get the logged in user's data (name, surname ,...)

Firefox, chrome it works perfectly

in IE i get an IOError without any descriptive data (2032 stream error)

any help or suggestion welcome :-)

Thanks,
Fotis



[flexcoders] When is there an update to flexbuilder that fixes these bugs on OSX

2010-06-03 Thread Patrick
1. De-selecting build automatically, still builds automatically
2. Refactoring - it's total crap. Sorry, but it screws up my project and misses 
all kinds of files while eclipse using java does this perfectly and fast, flex 
never gets this right
3. Copying and pasting multiple files into the project navigator, results in 
only the first one actually pastes into the project
4. Trying to report a bug throws an error only one copy of firefox can be 
launched at a time
5. modifying any static class takes the compiler forever to re-build

About about a 4.1 that solves these problems, how did this stuff get missed, 
does nobody at Adobe us a mac?






[flexcoders] DateField problem

2010-06-03 Thread Goutham
Hi

I have a date stored in the database along with other details.
have a datagrid that shows all the details, clicking on a row pops up a 
titlewindow showing all the details of that row which can be editable as in a 
form.

the problem is, I am not able to fill the datefield from the value in the 
dataobject

mx:DateField id=date selectedDate={new Date()} formatString=MM-DD- /

as code:

tried
date.text = selectedRow.Date (date value from the database)

doesn't give any errors, but the datefield is not filled with the date



[flexcoders] Need a cairngorm sample app with source code

2010-06-03 Thread K~SATHYAN~M
Hi flexers,

I am new to cairngorm.. i have using php and mysql as backend for flex +
cairngorm framework..

But i didn't get anything as code to pass data as follows..

Flex + Cairngorm  --  XML  --  PHP + MYSQL

Is it possible..?

It is possible i think..

But i didn't get a sample code yet..

So please send me a sample application with source code using php+mysql for
flex+cairngorm if you have..

I got a thing that data can pass through HTTP Service using Delegate in
cairngorm side..

But i can't implement it..

Need your help..

Thanks in advance..



- - - - - - - - -
With Regards,
Sathya Moorthi K


[flexcoders] Combobox in ItemEditor

2010-06-03 Thread Goutham
Hi,

I have a combobox in item editor in a datagrid. the combobox is populated with 
a dataprovider. All this works fine until I place this combobox inside a gird

working code


mxml code
-

datagridcolumn
 itemeditor
  component
 combobox dataprovider={outerDocument.data} ... /
  /component
 /itemeditor
/datagridcolumn

actionscript code
-
object.data = ComboBox(event.currentTarget.itemEditorInstance).text;



problematic code
---

datagridcolumn
 itemeditor
  component
   grid
gridrow
 griditem
  combobox dataprovider={outerDocument.data} ... /
 /griditem
/gridrow
   /grid
  /component
 /itemeditor
/datagridcolumn

actionscript code
-
object.data = ComboBox(event.currentTarget.itemEditorInstance).text;


error in the action script code:
---
cannot convert _inlinecompone...@3780479 to mx.controls.ComboBox

Here the itemeditorinstance is a grid so, probably its not able to convert to 
combobox, how do we get the selected value of the combobox from the itemeditor ?

I use the grid, as the rows are of variable height and the combobox looks huge 
if the height of the row is more

Thank you




Re: [flexcoders] Re: Comobox/DataGrid does not display data

2010-06-03 Thread Akshar Kaul
can you share the whole code or some sample code.

Akshar Kaul


On Tue, Jun 1, 2010 at 22:31, md_ars mdar...@gmail.com wrote:



 Thanks Ashkar for the reply,
 I had already tried but it didn't work


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Akshar
 Kaul akshar.k...@... wrote:
 
  try using formType.refresh() after you modify your array collection.
 
  Akshar Kaul
 
 
  On Sat, May 29, 2010 at 03:49, md_ars mdar...@... wrote:
 
  
  
   I have a Combobox and its dataprovide is an ArrayCollection(formType)
 which
   is being populate from XMLLIst(formXMLListB) as given below
  
   public function getForms(vForm:Object):void
   {
   formXMLListB = vForm.mtResult.tuples.item.tuple; // resultFormat=e4x
   var i:int = 0;
   formType.removeAll();
   for(i=0; iformXMLListB.length(); i++) {
   if (formXMLListB[i].item..stringValue[2] == 'FORM_TYPE'){
   formType.addItem({label:formXMLListB[i].item.stringValue[0].toString(),
   data:formXMLListB[i].item.stringValue[1].toString()
   }
   );
   }
   }
  
   For some reason combobox is not populate eventhough I can see the data
 in
   dataprovider when run with debugger. The formType is [Bindable]
 variable.
  
   mx:ComboBox id=frmType x=258 y=124 dataProvider={formType}
   labelField=label width=281 /
  
   It works fine when I define a dataprovider with static values.
  
   Any suggestions?
  
   Thanks
   Arshad
  
  
  
 

  



[flexcoders] question on validation

2010-06-03 Thread satish k
Hi, I was trying to implement the below thing but i could not get it can you 
please help me out with this

xxx will pre-populate the text box with the customer name and the CLf 
associated with the PNG using the following format:

customer name_CLF
•   Spaces in the customer name shall be replaced with a hyphen 

I want the customer name and clf to be changed but _ need to be constant. 

thanks




Re: [flexcoders] Re: Showing tooltip on the line

2010-06-03 Thread Akshar Kaul
i got a solution to this problem.

Make few changes in the drawtheline component.

Code :

?xml version=1.0 encoding=utf-8?

mx:Box 
xmlns:mx=http://www.adobe.com/2006/mxmlhttp://www.google.com/url?sa=Dq=http://www.adobe.com/2006/mxmlusg=AFQjCNEtcLsIWFCjy8rhxFxIJ8W2RHUpyw
width=400

height=300 creationComplete=createLine() borderColor=#00FF00
borderStyle=solid mouseMove=findTarget(event)

mx:Script

![CDATA[

*import* mx.core.UIComponent;

*import* mx.controls.Alert;

*private* *function* findTarget(event:MouseEvent):*void*{

*if* (event.target.name == *uiTest*)

*this*.toolTip=*this tooltip is coming only for the line*;

*else
*

*this*.toolTip = **;
}

*private* *function* createLine():*void*{

*var* g:Shape = *new* Shape();

g.graphics.lineStyle(2, 0xFF, .75);

g.graphics.moveTo(0,0);

g.graphics.lineTo(400,300);

g.name = *line*;

*this*.uiComp.addChild(g);
}

]]

/mx:Script

mx:UIComponent id=uiComp name=uiTest/
/mx:Box
Noe you can see the tool tip only for the line, not for the component :)




Akshar Kaul


On Wed, Jun 2, 2010 at 12:23, Akshar Kaul akshar.k...@gmail.com wrote:

 i am creating the line using graphics methods. i dont think they support
 event listeners.

 Akshar Kaul



 On Tue, Jun 1, 2010 at 19:09, valdhor valdhorli...@embarqmail.com wrote:



 If it were me, I would create a custom tooltip; add a mouseover event
 listener to your line; check the color directly under the mouse pointer and
 show the tooltip.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 akshar akshar.k...@... wrote:
 
  i have a line in my application. i require that a tooltip should come
  only on the line. The line is in a custom component. when i add the
  tooltip to the component it shows the tooltip for whole of the
  component. is there a way to show the tooltip only for the line.
  here is a sample which i am trying :-
 
  main application file:-
 
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  layout=absolute width=100% height=100% xmlns:local=*
  local:drawtheline/
  /mx:Application
 
  drawtheline component :-
 
  ?xml version=1.0 encoding=utf-8?
  mx:Box xmlns:mx=http://www.adobe.com/2006/mxml; width=400
  height=300 creationComplete=createLine() toolTip=this tooltip
  should come only on the line
  borderColor=#00FF00 borderStyle=solid
  mx:Script
  ![CDATA[
  import mx.core.UIComponent;
  private function createLine():void
  {
  var g:Shape = new Shape();
  g.graphics.lineStyle(2, 0xFF, .75);
  g.graphics.moveTo(0,0);
  g.graphics.lineTo(400,300);
  this.rawChildren.addChild(g);
  }
  ]]
  /mx:Script
  /mx:Box
 

  





Re: [flexcoders] Re: Showing tooltip on the line

2010-06-03 Thread Akshar Kaul
i am creating the line using graphics methods. i dont think they support
event listeners.

Akshar Kaul


On Tue, Jun 1, 2010 at 19:09, valdhor valdhorli...@embarqmail.com wrote:



 If it were me, I would create a custom tooltip; add a mouseover event
 listener to your line; check the color directly under the mouse pointer and
 show the tooltip.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, akshar
 akshar.k...@... wrote:
 
  i have a line in my application. i require that a tooltip should come
  only on the line. The line is in a custom component. when i add the
  tooltip to the component it shows the tooltip for whole of the
  component. is there a way to show the tooltip only for the line.
  here is a sample which i am trying :-
 
  main application file:-
 
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  layout=absolute width=100% height=100% xmlns:local=*
  local:drawtheline/
  /mx:Application
 
  drawtheline component :-
 
  ?xml version=1.0 encoding=utf-8?
  mx:Box xmlns:mx=http://www.adobe.com/2006/mxml; width=400
  height=300 creationComplete=createLine() toolTip=this tooltip
  should come only on the line
  borderColor=#00FF00 borderStyle=solid
  mx:Script
  ![CDATA[
  import mx.core.UIComponent;
  private function createLine():void
  {
  var g:Shape = new Shape();
  g.graphics.lineStyle(2, 0xFF, .75);
  g.graphics.moveTo(0,0);
  g.graphics.lineTo(400,300);
  this.rawChildren.addChild(g);
  }
  ]]
  /mx:Script
  /mx:Box
 

  



[flexcoders] spark Panel titleBar equivalent

2010-06-03 Thread bhaq1972
In flex 3
I used do add buttons to MyPanel (extends mx.containers.Panel) titleBar.

var button:Button = new Button();
this.titleBar.addChild(button);


whats the equivalent to this in Spark?

one way i'm thinking of is using a basic layout, and positioning the buttons 
where I want. 

Just wanted to get an idea what approach others would take.

thanks




[flexcoders] Re: Comobox/DataGrid does not display data

2010-06-03 Thread md_ars
Hi Ashkar,

It was happening due to sequence of Events in MATE framework. ComboBox issue is 
resolved. Though working but I am still not figure out how to handle sequencing 
of events in MATE.

Thanks anyway for the follow up.
Arshad

--- In flexcoders@yahoogroups.com, Akshar Kaul akshar.k...@... wrote:

 can you share the whole code or some sample code.
 
 Akshar Kaul
 
 
 On Tue, Jun 1, 2010 at 22:31, md_ars mdar...@... wrote:
 
 
 
  Thanks Ashkar for the reply,
  I had already tried but it didn't work
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Akshar
  Kaul akshar.kaul@ wrote:
  
   try using formType.refresh() after you modify your array collection.
  
   Akshar Kaul
  
  
   On Sat, May 29, 2010 at 03:49, md_ars mdars06@ wrote:
  
   
   
I have a Combobox and its dataprovide is an ArrayCollection(formType)
  which
is being populate from XMLLIst(formXMLListB) as given below
   
public function getForms(vForm:Object):void
{
formXMLListB = vForm.mtResult.tuples.item.tuple; // resultFormat=e4x
var i:int = 0;
formType.removeAll();
for(i=0; iformXMLListB.length(); i++) {
if (formXMLListB[i].item..stringValue[2] == 'FORM_TYPE'){
formType.addItem({label:formXMLListB[i].item.stringValue[0].toString(),
data:formXMLListB[i].item.stringValue[1].toString()
}
);
}
}
   
For some reason combobox is not populate eventhough I can see the data
  in
dataprovider when run with debugger. The formType is [Bindable]
  variable.
   
mx:ComboBox id=frmType x=258 y=124 dataProvider={formType}
labelField=label width=281 /
   
It works fine when I define a dataprovider with static values.
   
Any suggestions?
   
Thanks
Arshad
   
   
   
  
 
   
 





Re: [flexcoders] Blocking

2010-06-03 Thread Richard Rodseth
I was able to make an adjustment to the surrounding code, so this is no
longer an issue for me, but thanks for the information.

On Thu, Jun 3, 2010 at 3:55 AM, Oleg Sivokon olegsivo...@gmail.com wrote:



 You can load it with JavaScript synchronously, ExternalInterface is also
 synchronous, however, it is possible that you will run out of time and the
 application will crash because of that. Because, even though you can
 try-catch timeout error, if the function that produced the error won't exit,
 you will get another error that you cannot try-catch.
  



Re: [flexcoders] spark Panel titleBar equivalent

2010-06-03 Thread Alex Harui
Use a Custom skin for the Panel


On 6/3/10 8:13 AM, bhaq1972 mbha...@hotmail.com wrote:






In flex 3
I used do add buttons to MyPanel (extends mx.containers.Panel) titleBar.

var button:Button = new Button();
this.titleBar.addChild(button);

whats the equivalent to this in Spark?

one way i'm thinking of is using a basic layout, and positioning the buttons 
where I want.

Just wanted to get an idea what approach others would take.

thanks






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] Combobox in ItemEditor

2010-06-03 Thread Alex Harui
One way is to set an id=”foo” on the ComboBox, then use

object.data = ComboBox(Grid(event.currentTarget.itemEditorInstance).foo).text;

On 6/2/10 1:00 PM, Goutham goldensu...@yahoo.co.in wrote:






Hi,

I have a combobox in item editor in a datagrid. the combobox is populated with 
a dataprovider. All this works fine until I place this combobox inside a gird

working code


mxml code
-

datagridcolumn
 itemeditor
 component
 combobox dataprovider={outerDocument.data} ... /
 /component
 /itemeditor
/datagridcolumn

actionscript code
-
object.data = ComboBox(event.currentTarget.itemEditorInstance).text;

problematic code
---

datagridcolumn
 itemeditor
 component
 grid
 gridrow
 griditem
 combobox dataprovider={outerDocument.data} ... /
 /griditem
 /gridrow
 /grid
 /component
 /itemeditor
/datagridcolumn

actionscript code
-
object.data = ComboBox(event.currentTarget.itemEditorInstance).text;

error in the action script code:
---
cannot convert _inlinecompone...@3780479 to mx.controls.ComboBox

Here the itemeditorinstance is a grid so, probably its not able to convert to 
combobox, how do we get the selected value of the combobox from the itemeditor ?

I use the grid, as the rows are of variable height and the combobox looks huge 
if the height of the row is more

Thank you






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] DateField problem

2010-06-03 Thread Alex Harui
Set selectedDate, not text?


On 6/2/10 1:08 PM, Goutham goldensu...@yahoo.co.in wrote:






Hi

I have a date stored in the database along with other details.
have a datagrid that shows all the details, clicking on a row pops up a 
titlewindow showing all the details of that row which can be editable as in a 
form.

the problem is, I am not able to fill the datefield from the value in the 
dataobject

mx:DateField id=date selectedDate={new Date()} formatString=MM-DD- /

as code:

tried
date.text = selectedRow.Date (date value from the database)

doesn't give any errors, but the datefield is not filled with the date






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[flexcoders] Re: DateField problem

2010-06-03 Thread Goutham
thank you

I actually tried it first, the problem is the date is not set in a method call, 
dont know why, I tried to set it in the creation complete and it works fine.

Thank you

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Set selectedDate, not text?
 
 
 On 6/2/10 1:08 PM, Goutham goldensu...@... wrote:
 
 
 
 
 
 
 Hi
 
 I have a date stored in the database along with other details.
 have a datagrid that shows all the details, clicking on a row pops up a 
 titlewindow showing all the details of that row which can be editable as in a 
 form.
 
 the problem is, I am not able to fill the datefield from the value in the 
 dataobject
 
 mx:DateField id=date selectedDate={new Date()} formatString=MM-DD- 
 /
 
 as code:
 
 tried
 date.text = selectedRow.Date (date value from the database)
 
 doesn't give any errors, but the datefield is not filled with the date
 
 
 
 
 
 
 --
 Alex Harui
 Flex SDK Team
 Adobe System, Inc.
 http://blogs.adobe.com/aharui





[flexcoders] horizontal scrolling using keyboard

2010-06-03 Thread nhid
Hello,

Does anyone has an idea how to implement horizontal scrolling on a datagrid
using the keyboard?

Thank you...


[flexcoders] Event before preinitialize

2010-06-03 Thread dorkie dork from dorktown
Is there an event before application preinitialize that I can listen
for in the application?

JP


[flexcoders] Modify Flex ComboBox DataProvider

2010-06-03 Thread Angelo Anolin
I am finding some issues when I am trying to change a combobox's data provider.

I have a checkbox that would trigger whether a combobox would use an 
xmlListCollection of all Locations (xmllcAll) or an XMLListCollection of just a 
subset of locations (xmllcSubset).

In the change event of my checkbox, I have defined:

private function checkBox1_change(e:Event) :void
{
  if (e.currentTarget.selected == true)
  {
comboBox1.dataProvider = xmllcAll;
  }
  else
  {
comboBox1.dataProvider = xmllcSubset;
  }
}

By default, the comboBox's default dataProvider is the xmllcSubset.  When I 
tick the checkbox, I expect that the data for the combobox should now map to 
the data for the xmllcAll variable.  The comboBox does not get the proper 
values.  Is there anything that I need to do to refresh the comboBox and make 
the values that appear on the list those that were in the the proper 
xmllistcollection?

Thanks.

Angelo


  

[flexcoders] Best practice - remote calls from a flex library

2010-06-03 Thread gareth_arch
I'm trying to figure out best practice for making remote calls to my server 
from components that are in a flex library.

e.g.  I have a postal code lookup component.  This component will make require 
a user to enter a state, which will get all cities for that state (or counties, 
or metro areas, etc.).  This requires a database call.  Now rather than forcing 
the application that uses this component to make this call to the server then 
inject the resulting data results into the dataprovider for my postal code 
lookup component, I want the component to load this data.

Is it best practice to have something like com.mywebsite.business that contains 
the remote calls for the library, then the component, when needed, will load 
that data?

Just trying to get a few opinions on how everyone handles this.  I have another 
library that contains most of my business logic (services, VOs, events) and one 
that contains my components (modified arraycollections, customized comboboxes), 
but wasn't sure about adding these items in.

Any thoughts would be appreciated,

Thanks,



Re: [flexcoders] Best practice - remote calls from a flex library

2010-06-03 Thread Oleg Sivokon
I'm afraid you won't find a solution that covers all cases. We at some point
decided to not have any business / value objects and return the SQL data
unparsed  parse it on the client, of course not the other way, when sending
the data. This may be really controversially to the best practices, but in
our case performance matters more. Also, if you are building with AIR and
using local database (SQLite), whereas security is not of concern, but the
speed matters, then it's one case, once it requires roles, permissions etc,
that's the other case. Also, we found that we can make more efficient
serialization than AMF on our own, so, not really using value objects again.
However, this may be important if the traffic matters more then the
development speed / maintainability.

Best.

Oleg


Re: [flexcoders] Best practice - remote calls from a flex library

2010-06-03 Thread Angelo Anolin
Looks more like you are trying to achieve inversion of control principle.

Instead of the component calling invoking a method of an object, the object is 
*smart* enough to know when to invoke the call and provide data to the calling 
component.

i think your application should do just fine regardless whether you apply IOC. 
There are certain trade offs as well - from a cleaner code and maintainability 
point of view.  As much as I do in development, I only make the call to the 
database when necessary - regardless whether the call is from the component or 
the object. JIT - Just in time is more like it.




From: gareth_arch gareth_a...@yahoo.com
To: flexcoders@yahoogroups.com
Sent: Thu, 3 June, 2010 14:18:18
Subject: [flexcoders] Best practice - remote calls from a flex library

  
I'm trying to figure out best practice for making remote calls to my server 
from components that are in a flex library.

e.g.  I have a postal code lookup component.  This component will make require 
a user to enter a state, which will get all cities for that state (or counties, 
or metro areas, etc.).  This requires a database call.  Now rather than forcing 
the application that uses this component to make this call to the server then 
inject the resulting data results into the dataprovider for my postal code 
lookup component, I want the component to load this data.

Is it best practice to have something like com.mywebsite.business that contains 
the remote calls for the library, then the component, when needed, will load 
that data?

Just trying to get a few opinions on how everyone handles this.  I have another 
library that contains most of my business logic (services, VOs, events) and one 
that contains my components (modified arraycollections, customized comboboxes), 
but wasn't sure about adding these items in.

Any thoughts would be appreciated,

Thanks,


 


  

[flexcoders] DataGrid error when scrolling to last row and starting item edit

2010-06-03 Thread technusiast
Hi,

I have a subclass of the DataGrid, with two columns, each with its own 
renderer. One renderer has a button, which when clicked, starts item edit 
(consisting of a TextInput).

Consistently, when there are too many rows for one pageful, scrolling down to 
the last row and starting item edit, results in this error:

TypeError: Error #1010: A term is undefined and has no properties.
at 
mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4064]
at 
mx.controls::DataGrid/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:1804]
...

Any inputs on how to solve this greatly appreciated!

Line 4064 of the DataGrid class is:
var item:IListItemRenderer = 
actualContentHolder.listItems[actualRowIndex][actualColIndex];



[flexcoders] Re: Combobox in ItemEditor

2010-06-03 Thread Goutham
Hi Alex,

thank you, I tried it using an id for the combobox, gives me an error
Access of possibly undefined property foo through a reference with static type 
mx.containers:Grid

and there is also another problem, when I click on the column in the datagrid, 
the itemeditor changes to a combobox with the default value to be the first one 
in the dataprovider instead of the selected one

this didn't happen in the first case (first case I mean with out using the grid 
and gridrow) but here, I get a warning uable to bind to property 'datafield' 
on class 'object' (class is not an IEventDispatcher)

any suggestions

thank you

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 One way is to set an id=foo on the ComboBox, then use
 
 object.data = ComboBox(Grid(event.currentTarget.itemEditorInstance).foo).text;
 
 On 6/2/10 1:00 PM, Goutham goldensu...@... wrote:
 
 
 
 
 
 
 Hi,
 
 I have a combobox in item editor in a datagrid. the combobox is populated 
 with a dataprovider. All this works fine until I place this combobox inside a 
 gird
 
 working code
 
 
 mxml code
 -
 
 datagridcolumn
  itemeditor
  component
  combobox dataprovider={outerDocument.data} ... /
  /component
  /itemeditor
 /datagridcolumn
 
 actionscript code
 -
 object.data = ComboBox(event.currentTarget.itemEditorInstance).text;
 
 problematic code
 ---
 
 datagridcolumn
  itemeditor
  component
  grid
  gridrow
  griditem
  combobox dataprovider={outerDocument.data} ... /
  /griditem
  /gridrow
  /grid
  /component
  /itemeditor
 /datagridcolumn
 
 actionscript code
 -
 object.data = ComboBox(event.currentTarget.itemEditorInstance).text;
 
 error in the action script code:
 ---
 cannot convert _inlinecompone...@3780479 to mx.controls.ComboBox
 
 Here the itemeditorinstance is a grid so, probably its not able to convert to 
 combobox, how do we get the selected value of the combobox from the 
 itemeditor ?
 
 I use the grid, as the rows are of variable height and the combobox looks 
 huge if the height of the row is more
 
 Thank you
 
 
 
 
 
 
 --
 Alex Harui
 Flex SDK Team
 Adobe System, Inc.
 http://blogs.adobe.com/aharui





RE: [flexcoders] Event before preinitialize

2010-06-03 Thread Gordon Smith
I don't think so. How early do you need it? Why isn't preinitialize early 
enough?

- Gordon

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of dorkie dork from dorktown
Sent: Thursday, June 03, 2010 12:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Event before preinitialize



Is there an event before application preinitialize that I can listen
for in the application?

JP



[flexcoders] Re: Best practice - remote calls from a flex library

2010-06-03 Thread gareth_arch
I guess it's a little bit of IOC.  It's really based on environment as well, so 
we get the data from different places based upon where the code is deployed 
(dev, stg, prod, qa, etc).  In some of our other apps, we have the application 
set up to get postal codes, but that then starts assuming the app knows a 
lot about what to get and where to get it, rather than the components doing 
that for themselves.  I'll probably end up having some service calls within the 
library to get that information, but didn't know if someone had figured this 
out already.

I guess the 3 ways are:

1. Service calls within the library that point to the same spot each time (not 
optimal should the server change as it has in the past)
2. Have the app get the data and pass that on to the components (forces tight 
coupling with app, and having knowledge about the components)
3. Use a build script to compile the mxml/as files and thus have the 
environment built in that way.  (need to get antennae up and running...soon :)  
This way no matter where the file is deployed, it would get the data from the 
correct spot.)

4. Any other suggestions? :D

--- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote:

 Looks more like you are trying to achieve inversion of control principle.
 
 Instead of the component calling invoking a method of an object, the object 
 is *smart* enough to know when to invoke the call and provide data to the 
 calling component.
 
 i think your application should do just fine regardless whether you apply 
 IOC. There are certain trade offs as well - from a cleaner code and 
 maintainability point of view.  As much as I do in development, I only make 
 the call to the database when necessary - regardless whether the call is from 
 the component or the object. JIT - Just in time is more like it.
 
 
 
 
 From: gareth_arch gareth_a...@...
 To: flexcoders@yahoogroups.com
 Sent: Thu, 3 June, 2010 14:18:18
 Subject: [flexcoders] Best practice - remote calls from a flex library
 
   
 I'm trying to figure out best practice for making remote calls to my server 
 from components that are in a flex library.
 
 e.g.  I have a postal code lookup component.  This component will make 
 require a user to enter a state, which will get all cities for that state (or 
 counties, or metro areas, etc.).  This requires a database call.  Now rather 
 than forcing the application that uses this component to make this call to 
 the server then inject the resulting data results into the dataprovider for 
 my postal code lookup component, I want the component to load this data.
 
 Is it best practice to have something like com.mywebsite.business that 
 contains the remote calls for the library, then the component, when needed, 
 will load that data?
 
 Just trying to get a few opinions on how everyone handles this.  I have 
 another library that contains most of my business logic (services, VOs, 
 events) and one that contains my components (modified arraycollections, 
 customized comboboxes), but wasn't sure about adding these items in.
 
 Any thoughts would be appreciated,
 
 Thanks,





[flexcoders] Re: Best practice - remote calls from a flex library

2010-06-03 Thread gareth_arch
Yeah, I'm not really concerned about VOs vs queries, as that all depends on the 
situation.  I'm really just trying to figure out how to get that information 
into the library without coupling the component to an app or if there's even 
anything bad about putting the service calls for getting the information within 
the library itself (other than environmental issues i.e. dev vs stg vs prod).

--- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote:

 I'm afraid you won't find a solution that covers all cases. We at some point
 decided to not have any business / value objects and return the SQL data
 unparsed  parse it on the client, of course not the other way, when sending
 the data. This may be really controversially to the best practices, but in
 our case performance matters more. Also, if you are building with AIR and
 using local database (SQLite), whereas security is not of concern, but the
 speed matters, then it's one case, once it requires roles, permissions etc,
 that's the other case. Also, we found that we can make more efficient
 serialization than AMF on our own, so, not really using value objects again.
 However, this may be important if the traffic matters more then the
 development speed / maintainability.
 
 Best.
 
 Oleg





Re: [flexcoders] Event before preinitialize

2010-06-03 Thread dorkie dork from dorktown
 it's taking a couple of seconds to reach the preinitialize event.
according to this slideshow
http://www.slideshare.net/michael.labriola/dense-and-hot-360-flex slide 24,
25 etc
there are a couple things going on that i don't need early on. so i'd like
to check the contents of a shared object or session variable early on and
redirect to a much lighter login page if i need to.

On Thu, Jun 3, 2010 at 7:12 PM, Gordon Smith gosm...@adobe.com wrote:



  I don't think so. How early do you need it? Why isn't preinitialize early
 enough?



 - Gordon



 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *dorkie dork from dorktown
 *Sent:* Thursday, June 03, 2010 12:59 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Event before preinitialize





 Is there an event before application preinitialize that I can listen
 for in the application?

 JP

   



Re: [flexcoders] Event before preinitialize

2010-06-03 Thread Kerry Thompson

 it's taking a couple of seconds to reach the preinitialize event.
 according to this slideshow
 http://www.slideshare.net/michael.labriola/dense-and-hot-360-flex slide
 24, 25 etc
 there are a couple things going on that i don't need early on. so i'd like
 to check the contents of a shared object or session variable early on and
 redirect to a much lighter login page if i need to.


It doesn't take long to check the contents of a shared object. Why not just
do that before you intialize the object, and let it know whether to do the
lighter load?

Cordially,

Kerry Thompson


Re: [flexcoders] Event before preinitialize

2010-06-03 Thread dorkie dork from dorktown
That's what I'd like to do. So I added an event listener to the application
preinitialized event like so:

s:Application preinitialize=myHandler() /

the problem is, in my application it takes a while to get to that event. so
that's why I'm trying to find another event that happens sooner than that.
it would be great to have systemManager, fontManager, resourceManager and
styleManager creationComplete events so I can see what's taking so long in
addition to redirecting if I need to.

JP

On Thu, Jun 3, 2010 at 10:02 PM, Kerry Thompson al...@cyberiantiger.bizwrote:



  it's taking a couple of seconds to reach the preinitialize event.
 according to this slideshow
 http://www.slideshare.net/michael.labriola/dense-and-hot-360-flex slide
 24, 25 etc
 there are a couple things going on that i don't need early on. so i'd like
 to check the contents of a shared object or session variable early on and
 redirect to a much lighter login page if i need to.


 It doesn't take long to check the contents of a shared object. Why not just
 do that before you intialize the object, and let it know whether to do the
 lighter load?

 Cordially,

 Kerry Thompson
  



Re: [flexcoders] Event before preinitialize

2010-06-03 Thread Andriy Panas
Hi Judah,
AFAIK, you have 2 approaches to execute the code before
preinitialize event is fired.

1) Mark you class with metadata [Mixin] and put the code in need into method

public static function init(systemManager:ISystemManager):

See HowTo create your developer ToolBox with Mixins blog article
http://www.rialvalue.com/blog/2010/05/21/howto-create-your-developer-toolbox-with-mixins/

2) Via custom preloader class you can execute the code before
SystemManager.intialize() method executes,

See How I (sort of) modified Flex’s SystemManager.initialize() method
http://www.visible-form.com/blog/how-i-sort-of-modified-flexs-systemmanagerinitialize-method/

--
Best regards,
Andriy Panas



On 4 June 2010 06:57, dorkie dork from dorktown
dorkiedorkfromdorkt...@gmail.com wrote:



 That's what I'd like to do. So I added an event listener to the application 
 preinitialized event like so:

 s:Application preinitialize=myHandler() /

 the problem is, in my application it takes a while to get to that event. so 
 that's why I'm trying to find another event that happens sooner than that. it 
 would be great to have systemManager, fontManager, resourceManager and 
 styleManager creationComplete events so I can see what's taking so long in 
 addition to redirecting if I need to.

 JP

 On Thu, Jun 3, 2010 at 10:02 PM, Kerry Thompson al...@cyberiantiger.biz 
 wrote:



 it's taking a couple of seconds to reach the preinitialize event.
 according to this slideshow 
 http://www.slideshare.net/michael.labriola/dense-and-hot-360-flex slide 24, 
 25 etc
 there are a couple things going on that i don't need early on. so i'd like 
 to check the contents of a shared object or session variable early on and 
 redirect to a much lighter login page if i need to.


 It doesn't take long to check the contents of a shared object. Why not just 
 do that before you intialize the object, and let it know whether to do the 
 lighter load?

 Cordially,

 Kerry Thompson

 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

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

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
flexcoders-dig...@yahoogroups.com 
flexcoders-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
flexcoders-unsubscr...@yahoogroups.com

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



Re: [flexcoders] DataGrid error when scrolling to last row and starting item edit

2010-06-03 Thread Alex Harui
Can you reproduce the problem with a  generic two-column DataGrid?


On 6/3/10 3:48 PM, technusiast technusi...@yahoo.com wrote:






Hi,

I have a subclass of the DataGrid, with two columns, each with its own 
renderer. One renderer has a button, which when clicked, starts item edit 
(consisting of a TextInput).

Consistently, when there are too many rows for one pageful, scrolling down to 
the last row and starting item edit, results in this error:

TypeError: Error #1010: A term is undefined and has no properties.
at 
mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4064]
at 
mx.controls::DataGrid/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:1804]
...

Any inputs on how to solve this greatly appreciated!

Line 4064 of the DataGrid class is:
var item:IListItemRenderer = 
actualContentHolder.listItems[actualRowIndex][actualColIndex];






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] Modify Flex ComboBox DataProvider

2010-06-03 Thread Alex Harui
There’s a bug like that in Flex 3.5.  Older and newer versions don’t have that 
problem.


On 6/3/10 1:56 PM, Angelo Anolin angelo_ano...@yahoo.com wrote:






I am finding some issues when I am trying to change a combobox's data provider.

I have a checkbox that would trigger whether a combobox would use an 
xmlListCollection of all Locations (xmllcAll) or an XMLListCollection of just a 
subset of locations (xmllcSubset).

In the change event of my checkbox, I have defined:

private function checkBox1_change(e:Event) :void
{
  if (e.currentTarget.selected == true)
  {
comboBox1.dataProvider = xmllcAll;
  }
  else
  {
comboBox1.dataProvider = xmllcSubset;
  }
}

By default, the comboBox's default dataProvider is the xmllcSubset.  When I 
tick the checkbox, I expect that the data for the combobox should now map to 
the data for the xmllcAll variable.  The comboBox does not get the proper 
values.  Is there anything that I need to do to refresh the comboBox and make 
the values that appear on the list those that were in the the proper 
xmllistcollection?

Thanks.

Angelo







--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui