Hi Alina, The issue was in PopUp. The content was created before the popup is added, so the content was always getting 0 values for width and height. I fix the problem in a recent commit.
Far beyond that, I saw your code uses Grid-GridCell nested multiple times. That's not right, since Grid should be used "once per row" since is for responsivity (and then nest 1 or more GridCell to manage different device layouts). But having Grid nest other Grids is not recommended since is not needed and could reach you to unexpected results. A part from that, a minor fix is to avoid unneeded containers like the root HGroup. A better, less code code for your example should be: <j:Card xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:j="library://ns.apache.org/royale/jewel" xmlns:js="library://ns.apache.org/royale/basic" initComplete="trace('card ', event.target.width + ', ' + event.target.height);"> <fx:Script> <![CDATA[ import org.apache.royale.events.Event; private function createChart(event:Event):void { trace('hgroup ', event.target.width + ', ' + event.target.height); var totalheight:int = charTopesPerGen.height; var totalwidth:int = charTopesPerGen.width; lblStatus.text = charTopesPerGen.height + " height and width is " + charTopesPerGen.width; } ]]> </fx:Script> <j:beads> <js:ContainerDataBinding/> </j:beads> <j:CardPrimaryContent> <j:Label localId="lblStatus" /> <j:HGroup localId="charTopesPerGen" width="100%" height="100%" itemsVerticalAlign="itemsTop" initComplete="createChart(event)"/> </j:CardPrimaryContent> </j:Card> El mié., 26 ago. 2020 a las 14:58, Alina Kazi (<[email protected]>) escribió: > Hi Carlos, > > > https://github.com/alinakazi/ApacheRoyale/tree/example_heightwidthissueinHGroup > > I have created a separate example for the problem with the surrounding > code. > You are added as Collaborator to the repository. > > Thanks and Regards, > Alina Kazi > > On Wed, Aug 26, 2020 at 4:45 PM Carlos Rovira <[email protected]> > wrote: > >> Hi Alina, >> >> trying in TDJ's GridPlayGround.mxml works right. >> The problems is related to the place parent-child relation. Let me know >> more about the surrounding code. >> > -- Carlos Rovira http://about.me/carlosrovira
