RE: [flexcoders] Dynamically created children don't respect properties?

2005-09-28 Thread Matt Chotin










I think you may need to separate out your
styles and properties. For example width and height should be in that object
and done as numbers (you have them in quotes which means strings). But the
margins and borderStyles and colors are all styles and need to be applied using
setStyle I believe.



Matt











From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Noah Hoffman
Sent: Tuesday, September 27, 2005
10:53 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Dynamically
created children don't respect properties?





Hello,



Ive got some code
thats creating a bunch of nested tags based on the results of a
RemoteObject call. The problem is, none of the width or height settings
are working (or Im missing something else). Does anyone have any
ideas? When the code below gets rendered, Id expect a bunch of
repeating HBoxs to appear in the VBox vbDynamicStudies
. What I get instead is a huge blank panel with hscroll and
vscroll bars that are almost infinitely long. In order to debug
Ive tried setting explicit widths (like 100) and heights and have proven
that the nested tags are created properly, its just the layout
thats messed up. Any one have any ideas?



Thanks,

Noah





mx:Panel


xmlns:mx=http://www.macromedia.com/2003/mxml


xmlns:comp=components.* 


initialize=initComponent()


marginTop=3


marginLeft=5 


marginRight=5 creationPolicy=all


creationComplete=creationComplete()







mx:Script


 ![CDATA[




for(var n = 0; n  iterations; n++)


{



myHbox = null;


myHboxSub = null;


myVbox = null;





myHbox = HBox(vbDynamicStudies.createChild(HBox, undefined, 


{ marginTop:10,


 marginBottom:10,


 marginLeft:10,

 


 backgroundColor:#FF,


 mouseOver:changeBgColor(event, rollOverColor),


 mouseOut:changeBgColor(event, bgColor),


 borderStyle:solid
}));





myHboxSub = HBox(myHbox.createChild(HBox, undefined, 


 { backgroundColor:#CC,


width:160,


height:75,


borderStyle:solid,


borderThickness:2,


verticalAlign:middle,


horizontalAlign:center }));





myHboxSub.createChild(Text, undefined, 



{ text:Image Placeholder,




 textAlign:center,




 width:100%,



 height:160 });





myVbox = VBox(myHbox.createChild(VBox, undefined, { width:100% }
));





myVbox.createChild(Text, undefined, 


{ text:arResults[n].title,


 fontWeight:bold,


 fontSize:12,


 width:100% });





myVbox.createChild(Text, undefined, 


{ text:arResults[n].description,


 fontSize:10,


 width:100%
}); 


 


} 




 ]]


/mx:Script






mx:VBox id=vbDynamicStudies
width=100% 


/mx:VBox



/mx:Panel















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



  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] Dynamically created children don't respect properties?

2005-09-28 Thread Noah Hoffman










Yep, it was the quotes around the numeric
values (width and height) that caused the problem. Thanks for the help.













From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Chotin
Sent: Tuesday, September 27, 2005
11:05 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
Dynamically created children don't respect properties?





I think you may need to separate out your
styles and properties. For example width and height should be in that
object and done as numbers (you have them in quotes which means strings).
But the margins and borderStyles and colors are all styles and need to be
applied using setStyle I believe.



Matt











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Noah Hoffman
Sent: Tuesday, September 27, 2005
10:53 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Dynamically created
children don't respect properties?





Hello,



Ive got some code
thats creating a bunch of nested tags based on the results of a
RemoteObject call. The problem is, none of the width or height settings
are working (or Im missing something else). Does anyone have any
ideas? When the code below gets rendered, Id expect a bunch of
repeating HBoxs to appear in the VBox vbDynamicStudies
. What I get instead is a huge blank panel with hscroll and
vscroll bars that are almost infinitely long. In order to debug
Ive tried setting explicit widths (like 100) and heights and have proven
that the nested tags are created properly, its just the layout
thats messed up. Any one have any ideas?



Thanks,

Noah





mx:Panel


xmlns:mx=http://www.macromedia.com/2003/mxml


xmlns:comp=components.* 


initialize=initComponent()


marginTop=3


marginLeft=5 


marginRight=5 creationPolicy=all


creationComplete=creationComplete()







mx:Script


 ![CDATA[




for(var n = 0; n  iterations; n++)


{



myHbox = null;


myHboxSub = null;


myVbox = null;





myHbox = HBox(vbDynamicStudies.createChild(HBox, undefined, 


{ marginTop:10,


 marginBottom:10,


 marginLeft:10,

 


 backgroundColor:#FF,


 mouseOver:changeBgColor(event, rollOverColor),


 mouseOut:changeBgColor(event, bgColor),


 borderStyle:solid }));





myHboxSub = HBox(myHbox.createChild(HBox, undefined, 


 { backgroundColor:#CC,


width:160,


height:75,


borderStyle:solid,


borderThickness:2,


verticalAlign:middle,


horizontalAlign:center }));





myHboxSub.createChild(Text, undefined, 



{ text:Image Placeholder,




 textAlign:center,




 width:100%,



 height:160 });





myVbox = VBox(myHbox.createChild(VBox, undefined, { width:100% }
));





myVbox.createChild(Text, undefined, 


{ text:arResults[n].title,


 fontWeight:bold,


 fontSize:12,


 width:100% });





myVbox.createChild(Text, undefined, 


{ text:arResults[n].description,


 fontSize:10,


 width:100%
}); 


 


} 




 ]]


/mx:Script






mx:VBox
id=vbDynamicStudies width=100% 


/mx:VBox



/mx:Panel
















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



  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.