Re: [flexcoders] Re: Strange Behavior When Loading Sub Application

2010-05-13 Thread Alex Harui
Flex SWFs must be on-stage in order to load.  Are you worried about missing an 
ADD_TO_STAGE event?  Maybe send a fake one on applicationComplete.


On 5/13/10 7:51 AM, jmbo...@bellsouth.net jim_bo...@premierinc.com wrote:






Alex,

Your suggestion will work and in fact, that is the way we were doing it. 
Unfortunately, we needed to create a Robotlegs context so that we can listen 
for ADD_TO_STAGE events and allow it to automatically mediator our view 
components (see below).  That is why I added the sub-app as a child later.  Any 
other ideas how to make the current code work?

// Inject dependencies into the module and initiate the context since autoload 
is set
var subApp:IModule = event.moduleApp;
injector.injectInto(subApp);

// Make sure the content fills the page
var subAppComponent:SubAppBase = SubAppBase(subApp);
subAppComponent.percentHeight = 100;
subAppComponent.percentWidth = 100;

/* Add to contentViewStack here based upon position
   Simply add as a child to the stub canvas that already
   exists for the module
 */
var index:int = _moduleArray.getItemIndex(swf);
var canvas:Canvas = Canvas(contentViewStack.getChildAt(index));

canvas.addChild(subAppComponent);

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

 Try adding the SWFLoader to the canvas before you load it.


 On 5/12/10 12:40 PM, jmbo...@... jim_bo...@... wrote:






 Hi,

 I am experiencing an odd problem and I hope someone knows why.  I am loading 
 a sub-application using SWFLoader.  I listen for the Event.COMPLETE command. 
 Once the swf is loaded, I then add a listener to the SystemManager for the 
 swf and listen for the FlexEvent.APPLICATION_COMPLETE event.  At that point, 
 I add the application as a child to a Canvas that exists in a view stack (see 
 code below).  This is great, the content loads, but it doesn't seem to load 
 correctly.  The legends in my charts are not oriented the way they should be 
 and whenever I roll over an item with a tooltip, I get errors like the 
 following error:

 TypeError: Error #1009: Cannot access a property or method of a null object 
 reference.
 at mx.managers::SystemManager/get 
 toolTipChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1178]
 at 
 mx.charts.chartClasses::ChartBase/updateDataTipToMatchHitSet()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\ChartBase.as:3030]

 Does anyone have any clue what is going on??  Thanks,

 Jim

 !! snippet where swf is loaded 

 ..
 var loader:SWFLoader = null;
 if (content.contentType == ContentData.SWF)
 {
 var uri:String = content.contentUri;

 var loaderContext:LoaderContext = new LoaderContext();
 loaderContext.applicationDomain = ApplicationDomain.currentDomain;
 loaderContext.securityDomain = SecurityDomain.currentDomain;

 /* Create the swf loader and add it as a child to a canvas
  * so that it will have a place to display on the display list
  */
 loader = new SWFLoader();
 loader.scaleContent = true;
 loader.loaderContext = loaderContext;
 loader.addEventListener(Event.COMPLETE, onLoadingComplete);
 loader.addEventListener(IOErrorEvent.IO_ERROR, onModuleLoadError);
 loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onModuleLoadError);
 loader.load(uri);
 .

 private function onLoadingComplete(event:Event):void
 {
 var swfLoader:SWFLoader = event.currentTarget as SWFLoader;
 if (swfLoader != null  swfLoader.content != null)
 {
 /* Create an annoymous listener that dispatches an event when the module is 
 ready to show */
 sm.addEventListener(FlexEvent.APPLICATION_COMPLETE, 
 function(flexEvent:FlexEvent):void
 {
 var cmEvent:ContentManagementEvent = new 
 ContentManagementEvent(ContentManagementEvent.CONTENT_READY_TO_SHOW);
 cmEvent.moduleLoader = swfLoader;
 // Grab a reference to the module application itself
 if (flexEvent.currentTarget.application is IModule)
 {
 cmEvent.moduleApp = flexEvent.currentTarget.application as IModule;
 }
 dispatch(cmEvent);

 });
 }
 }
 }

 !! snippet when adding to Canvas 

 if (event.moduleApp != null)
 {
 Logger.debug(Setting parentInjector and starting the RL context for : + 
 moduleId);

 // Make sure the content fills the page
 var subAppComponent:SubAppBase = SubAppBase(subApp);
 subAppComponent.percentHeight = 100;
 subAppComponent.percentWidth = 100;

 /* Add to contentViewStack here based upon position
Simply add as a child to the stub canvas that already
exists for the module
  */
 var index:int = _moduleArray.getItemIndex(swf);
 var canvas:Canvas = Canvas(contentViewStack.getChildAt(index));

 canvas.addChild(subAppComponent);
 }






 --
 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


Re: [flexcoders] Re: Strange Behavior When Loading Sub Application

2010-05-13 Thread Alex Harui
Thinking about this a bit more, every child of the sub-swf except its 
systemmanager should get an ADD_TO_STAGE around the time of applicationComplete 
in the sub-swf.  Flex builds the SWF’s ui off-stage.  So maybe there’s 
something else going on.


On 5/13/10 12:01 PM, jmbo...@bellsouth.net jim_bo...@premierinc.com wrote:






Robotlegs uses the ADD_TO_STAGE to auto-magically mediate view components so 
dispatching 1 event would not work...I would have to dispatch 1 for each 
component.  I can manually mediate the components, but that is a lot of work 
for a large app and takes the magic away from RL.  I will just have to pursue 
another strategy.  Thanks for your confirmation Alex!

Jim

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

 Flex SWFs must be on-stage in order to load.  Are you worried about missing 
 an ADD_TO_STAGE event?  Maybe send a fake one on applicationComplete.


 On 5/13/10 7:51 AM, jmbo...@... jim_bo...@... wrote:






 Alex,

 Your suggestion will work and in fact, that is the way we were doing it. 
 Unfortunately, we needed to create a Robotlegs context so that we can listen 
 for ADD_TO_STAGE events and allow it to automatically mediator our view 
 components (see below).  That is why I added the sub-app as a child later.  
 Any other ideas how to make the current code work?

 // Inject dependencies into the module and initiate the context since 
 autoload is set
 var subApp:IModule = event.moduleApp;
 injector.injectInto(subApp);

 // Make sure the content fills the page
 var subAppComponent:SubAppBase = SubAppBase(subApp);
 subAppComponent.percentHeight = 100;
 subAppComponent.percentWidth = 100;

 /* Add to contentViewStack here based upon position
Simply add as a child to the stub canvas that already
exists for the module
  */
 var index:int = _moduleArray.getItemIndex(swf);
 var canvas:Canvas = Canvas(contentViewStack.getChildAt(index));

 canvas.addChild(subAppComponent);

 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com  
 mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote:
 
  Try adding the SWFLoader to the canvas before you load it.
 
 
  On 5/12/10 12:40 PM, jmboone@ jim_boone@ wrote:
 
 
 
 
 
 
  Hi,
 
  I am experiencing an odd problem and I hope someone knows why.  I am 
  loading a sub-application using SWFLoader.  I listen for the Event.COMPLETE 
  command. Once the swf is loaded, I then add a listener to the SystemManager 
  for the swf and listen for the FlexEvent.APPLICATION_COMPLETE event.  At 
  that point, I add the application as a child to a Canvas that exists in a 
  view stack (see code below).  This is great, the content loads, but it 
  doesn't seem to load correctly.  The legends in my charts are not oriented 
  the way they should be and whenever I roll over an item with a tooltip, I 
  get errors like the following error:
 
  TypeError: Error #1009: Cannot access a property or method of a null object 
  reference.
  at mx.managers::SystemManager/get 
  toolTipChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1178]
  at 
  mx.charts.chartClasses::ChartBase/updateDataTipToMatchHitSet()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\ChartBase.as:3030]
 
  Does anyone have any clue what is going on??  Thanks,
 
  Jim
 
  !! snippet where swf is loaded 
 
  ..
  var loader:SWFLoader = null;
  if (content.contentType == ContentData.SWF)
  {
  var uri:String = content.contentUri;
 
  var loaderContext:LoaderContext = new LoaderContext();
  loaderContext.applicationDomain = ApplicationDomain.currentDomain;
  loaderContext.securityDomain = SecurityDomain.currentDomain;
 
  /* Create the swf loader and add it as a child to a canvas
   * so that it will have a place to display on the display list
   */
  loader = new SWFLoader();
  loader.scaleContent = true;
  loader.loaderContext = loaderContext;
  loader.addEventListener(Event.COMPLETE, onLoadingComplete);
  loader.addEventListener(IOErrorEvent.IO_ERROR, onModuleLoadError);
  loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, 
  onModuleLoadError);
  loader.load(uri);
  .
 
  private function onLoadingComplete(event:Event):void
  {
  var swfLoader:SWFLoader = event.currentTarget as SWFLoader;
  if (swfLoader != null  swfLoader.content != null)
  {
  /* Create an annoymous listener that dispatches an event when the module is 
  ready to show */
  sm.addEventListener(FlexEvent.APPLICATION_COMPLETE, 
  function(flexEvent:FlexEvent):void
  {
  var cmEvent:ContentManagementEvent = new 
  ContentManagementEvent(ContentManagementEvent.CONTENT_READY_TO_SHOW);
  cmEvent.moduleLoader = swfLoader;
  // Grab a reference to the module application itself
  if (flexEvent.currentTarget.application is IModule)
  {
  cmEvent.moduleApp = flexEvent.currentTarget.application as IModule;
  }
  dispatch(cmEvent);
 

RE: [flexcoders] Re: Strange behavior

2008-05-06 Thread Alex Harui
If you look at the comboboxheaderrenderer example you'll see that it
always pulls its data from the column so the renderer can be recycled or
recreated.  It does not store state within itself

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of markgoldin_2000
Sent: Tuesday, May 06, 2008 3:17 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Strange behavior

 

I see. I am looking into your blog to find the answer but I can't 
find it. Could you please help me to understand what do I do with 
recycling problem?

Thanks alot.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Alex Harui [EMAIL PROTECTED] wrote:

 Even headerRenderers get recycled.
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of markgoldin_2000
 Sent: Tuesday, May 06, 2008 2:23 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Strange behavior
 
 
 
 I am trying to implement a checkbox as a headerRenderer:
 public class CheckBoxHeaderRenderer extends CheckBox
 {
 private var _parentGrid:DataGrid = new DataGrid();
 public function CheckBoxHeaderRenderer()
 {
 super();
 selected = true;
 addEventListener(click, clickHandler);
 } 
 override protected function clickHandler
 (event:MouseEvent):void
 {
 super.clickHandler(event);
 parentGrid.dataProvider[0].processorder = 10;
 }
 public function set parentGrid(value:DataGrid):void
 {
 _parentGrid = value;
 }
 public function get parentGrid():DataGrid
 {
 return _parentGrid;
 }
 }
 That works fine except that when I click on a checkbox it does not 
 lose it check mark. Commenting out:
 parentGrid.dataProvider[0].processorder = 10;
 will resore checkbox's behavior. What am I missing?
 
 Thanks


 



RE: [flexcoders] Re: Strange behavior

2008-05-06 Thread Alex Harui
The examples on my blog extend DataGridColumn to add a place for the
renderer to store things

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of markgoldin_2000
Sent: Tuesday, May 06, 2008 3:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Strange behavior

 

But I am using checkbox (is that what you meant?) in the header. Does 
it have any kind of data to base the checkbox's state on?

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Alex Harui [EMAIL PROTECTED] wrote:

 If you look at the comboboxheaderrenderer example you'll see that it
 always pulls its data from the column so the renderer can be 
recycled or
 recreated. It does not store state within itself
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of markgoldin_2000
 Sent: Tuesday, May 06, 2008 3:17 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Re: Strange behavior
 
 
 
 I see. I am looking into your blog to find the answer but I can't 
 find it. Could you please help me to understand what do I do with 
 recycling problem?
 
 Thanks alot.
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com  mailto:flexcoders%
40yahoogroups.com
 , Alex Harui aharui@ wrote:
 
  Even headerRenderers get recycled.
  
  
  
  
  
  From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com  mailto:flexcoders%
40yahoogroups.com
 
 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com  mailto:flexcoders%
40yahoogroups.com
 ] On
  Behalf Of markgoldin_2000
  Sent: Tuesday, May 06, 2008 2:23 PM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%
40yahoogroups.com 
  Subject: [flexcoders] Strange behavior
  
  
  
  I am trying to implement a checkbox as a headerRenderer:
  public class CheckBoxHeaderRenderer extends CheckBox
  {
  private var _parentGrid:DataGrid = new DataGrid();
  public function CheckBoxHeaderRenderer()
  {
  super();
  selected = true;
  addEventListener(click, clickHandler);
  } 
  override protected function clickHandler
  (event:MouseEvent):void
  {
  super.clickHandler(event);
  parentGrid.dataProvider[0].processorder = 10;
  }
  public function set parentGrid(value:DataGrid):void
  {
  _parentGrid = value;
  }
  public function get parentGrid():DataGrid
  {
  return _parentGrid;
  }
  }
  That works fine except that when I click on a checkbox it does 
not 
  lose it check mark. Commenting out:
  parentGrid.dataProvider[0].processorder = 10;
  will resore checkbox's behavior. What am I missing?
  
  Thanks
 


 



Re: [flexcoders] Re: Strange Behavior on DataGrid Resize - Column Resize below Minimum Width

2007-05-14 Thread Tom Chiverton
On Friday 11 May 2007, iko_knyphausen wrote:
 Now you got me confused. I am running 2.01, and I just went to Adobes
 site. I did not see a Hotfix 1, just the 2.01. Where would I find Hotfix
 1 of Version 2.01?

http://rachaelandtom.info/node/1440

-- 
Tom Chiverton
Helping to dynamically transition corporate features
on: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



--
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/

* 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:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* 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] Re: Strange behavior in datagrid

2006-07-20 Thread Joe Stramel





Colin,

You got it. I had a font-family: Arial 
attribute in my application css. As soon as I took it out, viola! 
Thanks!

Joe


  - Original Message - 
  From: 
  Colin 
  Wiseley 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 20, 2006 12:24 
  PM
  Subject: [flexcoders] Re: Strange 
  behavior in datagrid
  
  
  
  
  I had this problem too with extra 
  rows displaying sometimes both above and below the actual control as you 
  scrolled the datagrid. I had an embedded font in the header style for 
  the datagrid. Turning off the embedded font and using a client font for 
  the header fixed it for me.
  
  Colin
  
  
  
  --- In flexcoders@yahoogroups.com, "Joe 
  Stramel" [EMAIL PROTECTED] wrote:
  
   I have a datagrid in my app 
  that is displaying one row of data BELOW the actual visible control. Any 
  idea what could cause something like that?
  
  
  
__._,_.___





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








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___



Re: [flexcoders] Re: Strange behavior in datagrid

2006-07-20 Thread Joe Stramel





Just to clarify...it wasn't actually the font for 
me. It was because I set the font-size to 12. When I changed it to 
11 the problem went away.


  - Original Message - 
  From: 
  Colin 
  Wiseley 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 20, 2006 12:24 
  PM
  Subject: [flexcoders] Re: Strange 
  behavior in datagrid
  
  
  
  
  I had this problem too with extra 
  rows displaying sometimes both above and below the actual control as you 
  scrolled the datagrid. I had an embedded font in the header style for 
  the datagrid. Turning off the embedded font and using a client font for 
  the header fixed it for me.
  
  Colin
  
  
  
  --- In flexcoders@yahoogroups.com, "Joe 
  Stramel" [EMAIL PROTECTED] wrote:
  
   I have a datagrid in my app 
  that is displaying one row of data BELOW the actual visible control. Any 
  idea what could cause something like that?
  
  
  
__._,_.___





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








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___