How to get the height of the component (located in %) on its parent creationComplete event

Hello

I've got a component with height = 100% ownership. This component has a child with height = 80 percent ownership. I need to get the value of the height of the child on the complete creation of the parent event. Problem is that the size of the child is set to a default value when sends this event. Correct height value is more later (I don't know when).

I tried to use child.validateNow () and parent.validateNow (), but without result. Any suggestions?

I should add that this child is inside the tabNavigator to the 2nd tab. There should be no impact if becouse tabNavigator has creationPolicy set to 'all '.

Looks like than ViewStacks no children available to be chosen so your

workaround is probably correct.  If we put out all the children, it would be wrong

even more performance.

Tags: Flex

Similar Questions

  • How to get the current location in the event thread?

    Hello!

    Can U pls tell me how to get the location where the thread object, it is in method() execution of MenuItem. PLS, tell me-

    I also used the different thread for the getLocation() method. But I do not have the coords of geo location...

    PLS, suggest me-

    My code is as below:

        private MenuItem getGeoCodes=new MenuItem("Current Coords",100,1){
    
                                 public void run(){
                                     double[] coords=getLocationCoords();
                                     this.wait(12000);
                                     System.out.println("Latitude :"+coords[0]+" "+"Longitude:"+coords[1]);
                                 }
    
                     };
    
        private double[] getLocationCoords(){
            Criteria criteria = new Criteria();
            criteria.setHorizontalAccuracy(500);
            criteria.setVerticalAccuracy(500);
            LocationProvider locationProvider = LocationProvider.getInstance(criteria);
            Location location=null;
            new Thread(){
               public void run(){
                       locationProvider.getLocation(60);
               }
            }
            QualifiedCoordinates qualifiedCoordinates=location.getQualifiedCoordinates();
            double[] coords=new double[]{qualifiedCoordinates.getLatitude(),qualifiedCoordinates.getLongitude()}   ;
             return coords;
        }
    

    But I myself NullPointerException. Coordinates get successfully, if we run the location capability in different function, rather than the event thread.

    Please help me-

    In my opinion, which may be too complicate things a bit. I think he's trying to do is register a LocationListener with his object of LocationProvider. Callback methods, send a message to the UI event thread as follows (no need to spawn threads):

    UiApplication.getUiApplication().invokeLater( new Runnable() {
        public void run()
        {
            // This code will execute on the event thread
        }
    });
    

    EDIT: If your interval is short, you can consider implementing this executable as a class and store an instance in the front.

  • How to get the web client to refresh its point of view of the deployment of openstack

    Hello

    I had a problem with my MariaDBs which caused Violence to fail to start after his stop. The webclient service displays a message that failed "bootstrap" and newspapers showed that the databases where failing to start. I got data bases and went 'vioconfig start' of the converted VIO openstack starting towards the high fine. IM able to connect to the dashboard and perform all tasks as before so, everything seems to work very well. However the webclient service always shows VIO in a State with the "bootstrap" of initial start error and error. How can I get the webclient service to acknowledge that Violence now is working well?

    Hello

    Here are the steps to synchronize the user interface with the backend.

    1 > please use the user interface to start and stop the Openstack and avoid using CLI tool (because the tool doesn't have sync the database)

    2 > if you do not have to use the user interface to start the deployment (generally, it was caused by the inconsistent database), then you can manually recovered databases.

    3 > using the method as Arvind suggested but instead of changing the status of 'RUNNING', please change it to "STOPPED".

    4 > then come to the user interface to use the user interface to start the cluster.

    Hereby you will have everthing sync upward.

    Kind regards

    Yixing.

  • How to get the selected tree node and its attributes

    I have a 'af:RichTree' on a page, which is linked to a support bean (session scope)

    Here is my selection Listener:

    {} public void groupTreeSelectionListener (SelectionEvent selectionEvent)
    RichTree tree = (RichTree) selectionEvent.getSource ();
    Model TreeModel (TreeModel) = tree.getValue (); / /--> this line causes a "pointer Exception zero."
    RowKeySet rowKeySet = selectionEvent.getAddedSet ();
    Key of the object = rowKeySet.iterator () .next ();
    }




    what I'll do is get the note selected and then get all the attributes of this node, perform other actions.


    Please advise,

    Thank you
    Shahab

    have not tried the tree component but cross chek well's Rowselection component of the tree. If so set to single or multiple

  • How to get the component custom property

    I have a custom component that is repeated as follows:

    < mx:Repeater id = dataProvider = "{this.category1"productsRepeater"}" > "

    "< mouseOver =" CFSMouseOver_Folder (event) "local: ComFolderItem" click = "CFSClick_Folder (event)" studentName ='{productsRepeater.currentItem.productName + "(" + productsRepeater.currentItem.productPrice + "") "'}" > "

    < / local: ComFolderItem >

    < / mx:Repeater >

    And I want back the studentName and productPrice when this component is clicked on

    private void CFSClick_Folder(evt_obj:Object):void {}

    var studentName:String =?

    }

    Please can someone tell me how I can get this value?

    Thank you

    Paul

    I think you would be after something like:

    private void CFSClick_Folder(event:Event):void {}
    var studentName:String = event.currentTarget.getRepeaterItem (.studentName)
    }

  • How to get the static attribute by using its name as a string

    I have an app with about 100 boxes of single drop-down list (this is a requirement of the Government, I'm not that bad a designer) and I would like to define the choices in a single file separated like this:

    package components {}

    Import mx.collections.ArrayCollection;

    public class {choice}

    [Bindable] public static var A0310A: collection ArrayCollection = new ArrayCollection ([] collection
    {value: '01', label: 'Admission'},
    {value: "02", label: "Quarterly"},
    .. .snip...
    ([{value: "99", label: "NOT the OBRA required"}]) ;

    public static void getChoices(name:String):ArrayCollection {}
    var temp: ArrayCollection = collection?
    Return temp;
    }

    }//----------------end of class--------------------------------
    }//======================== end of package==============================

    I want to use it like this

    < my: ComboBox id = "mdscombo" tag = "A0310A" / >

    Where the definition of my: ComboBox includes the code like this

    var zz:ArrayCollection = Choices.getChoices (name);

    but I can not find any function that will allow me to do.  I don't want really clutter up the code by creating a name-> object mapping table.

    I had also considered using the XML data type, but I have the same question, unless I had all the choices under a single root (possible), but this could be a nightmare when debugging in typo XML file.

    Any suggestions?

    To answer your question, you can access static variables with a chain in this way:

    Choice ["A0310A"]

    However, you probably want to re-evaluate your design because this isn't a very desirable approach.

  • How to get the path of the directory component in custom filter

    How to get the path of the directory component in a custom filter?
    final String absoluteComponentPath = CompInstallUtils.computeAbsoluteComponentLocation( "yourComponentName" );
    
  • How to get the width and height of Flex Mobile view?

    Hello

    The following instructions can get the width and height of the current Flex app:

    var request: UIComponent = FlexGlobals.topLevelApplication as UIComponent;

    trace (application. Width);

    trace (application. Height);

    But I don't know how to get the width and height of mobile display Flex current (i.e. the content size excludes bar action and the Navigation bar). Why the "this.width" always returns 0?

    Thank you!

    Looks like you're running in this bug: https://bugs.adobe.com/jira/browse/SDK-30070

  • How to get the RGB color values on the color picker component?

    How to get the RGB color values on the color picker component?

    trace (cp.selectedColor);

    Returns something like:

    16750950

    trace (key2cp.hexValue);

    Returns:

    ff9966

    I'm looking for RGB, for example, 0.5 0.5 0.5, corresponding to a gray color.

    Is there a chance that the RGB settings are hidden somewhere or is there a conversion function at least?

    Thank you.

    If key2cp.hexValue returns a string like 'abcdef', use:

    var s:String = key2cp.hexValue;

    var n: Number = Number("0x"+s);

    var r: Number = n > 16 & 0xff;
    var g:Number = n > 8 & 0xff;
    var b:Number = n & 0xff;

  • How to get the property of the image on the width and height?

    Hi, all, I import image from the outside with the following method, but how to get the w3c_main.png on the width and height property? I will appreciate for your answer.

    var mcLoader = new MovieClipLoader()
    mcLoader.loadClip (" http://www.w3.org/Icons/w3c_main.png", image);

    or an image. LoadMovie (" http://www.w3.org/Icons/w3c_main.png")

    in the first case use the method onLoadInit() to a listener for your mcl before trying to access your target movieclip laborious and _height properties.

    in the second, use the preloader code to ensure your png loading is completed before attempting to access the _width and _height of your target movieclip properties image.

  • How to get the bar display of title in pixels text length?

    Hello

    Does anyone know how to get the length of the title bar text (in pixels) display?  Just to clarify, that's what I'm looking for:

    I don't see a CVI function for this.  The attribute ATTR_TITLE_FONT for GetPanelAttribute (...) is only valid for the panels of the child which prevents me from using the GetTextDisplaySize (...) to get the size.  Dive into the Windows SDK I can not even find an answer here.  Any ideas?  Thank you.

    Figured out how to do this.  Go to the SDK to get the font properties - is kind of nonobviousness.  But once you have the font properties, you can create a font of meta in CVI, with properties, and once you have the meta font you can use GetTextDisplaySize (...) to get the size.  For any future reference:

    //define a NONCLIENTMETRICS structureNONCLIENTMETRICS ncmtest;//We have to set the cbSize parameter to the size of the passed structure before retrieving it
    ncmtest.cbSize = sizeof(NONCLIENTMETRICS);
    //Get NONCLIENTMETRICS structure
    result = SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncmtest, 0);
    
    //copy the title font name to a c-string
    while(ncmtest.lfCaptionFont.lfFaceName[i] != 0)
    {
        thefont[i] = (char)ncmtest.lfCaptionFont.lfFaceName[i];
        ++i;
    }
    
    //null terminate
    thefont[i] = '\0';
    
    //create meta font with title font properties.  lfWeight & 0x700 indicates bold.  CreateMetaFontWithCharacterSet() doesn't recognize DEFAULT_CHARSET so we replace it with VAL_NATIVE_CHARSET(?).
    uir_status = CreateMetaFontWithCharacterSet ("TheTitleFont", thefont, abs(ncmtest.lfCaptionFont.lfHeight), ncmtest.lfCaptionFont.lfWeight & 0x700 ? 1 : 0, ncmtest.lfCaptionFont.lfItalic, ncmtest.lfCaptionFont.lfUnderline, ncmtest.lfCaptionFont.lfStrikeOut, 0, ncmtest.lfCaptionFont.lfCharSet == DEFAULT_CHARSET ? VAL_NATIVE_CHARSET : ncmtest.lfCaptionFont.lfCharSet);
    
    //get titlebar text
    uir_status = GetPanelAttribute (panelhandle, ATTR_TITLE, thetext);
    //get title bar length
    uir_status = GetTextDisplaySize (thetext, "TheTitleFont", &height, &width);
    

    I have a 79 for the duration of the screenshot above.

  • How to get the element selected listfield and goto next page?

    Assalaamualikum

    I try parsing the XML from a url and show in listfield.

    problem:

    How to get the selected item and passing the variable and than goto next page?

    my code:

    package parsepack;

    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Vector;

    Import javax.microedition.io.Connector;
    Import javax.microedition.io.StreamConnection;

    Import net.rim.device.api.system.Bitmap;
    Import net.rim.device.api.system.Display;
    Import net.rim.device.api.ui.DrawStyle;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.FieldChangeListener;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.Manager;
    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.ListField;
    Import net.rim.device.api.ui.component.ListFieldCallback;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.container.VerticalFieldManager;
    Import net.rim.device.api.xml.parsers.DocumentBuilder;
    Import net.rim.device.api.xml.parsers.DocumentBuilderFactory;

    to import org.W3C.DOM.document;
    Import org.w3c.dom.Node;
    Import org.w3c.dom.NodeList;

    extends xmlparsing public class UiApplication implements ListFieldCallback, FieldChangeListener
    {

    Public Shared Sub main (String [] args)
    {
    xmlparsing app = new xmlparsing();
    app.enterEventDispatcher ();
    }

    public long mycolor;
    Connection _connectionthread;
    private static ListField _list;
    private static Vector listElements is new Vector();.
    public display display = new MainScreen();
    MainManager VerticalFieldManager;
    VerticalFieldManager subManager;

    public xmlparsing()
    {
    Super();
    pushScreen (screen);

    final Bitmap Imagearriereplan = Bitmap.getBitmapResource ("blackbackground.png");

    mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL |) Manager.NO_VERTICAL_SCROLLBAR)
    {

    public void paint (Graphics graphics)
    {
    graphics.drawBitmap (0, 0, Display.getWidth (), Display.getHeight (), Imagearriereplan, 0, 0);

    Super.Paint (Graphics);
    }

    };

    subManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL |) Manager.VERTICAL_SCROLLBAR)
    {
    protected void sublayout (int maxWidth, maxHeight int)
    {
    int displayWidth = Display.getWidth ();
    int displayHeight = Display.getHeight ();

    Super.sublayout (displayWidth, displayHeight);
    setExtent (displayWidth, displayHeight);
    }
    };

    Screen.Add (mainManager);

    _list = new ListField()

    {

    public void paint (Graphics graphics)

    {
    graphics.setColor ((int) mycolor);
    Super.Paint (Graphics);

    }

    };
    myColor = 0x00FFFFFF;
    _list. Invalidate();
    _list.setEmptyString ("* only supplies not available *", DrawStyle.HCENTER "");
    _list.setRowHeight (50);
    _list.setCallback (this);
    mainManager.add (subManager);
    listElements.removeAllElements ();
    _connectionthread = New Connection();
    _connectionthread. Start();
    }

    protected boolean navigationClick (int status, int time)
    {
    Try
    {
    Here, go to another screen if you need.

    }
    catch (System.Exception e)
    {
    System.out.println ("Exception:-: navigationClick()" + try ());
    }
    Returns true;
    }

    private class login extends thread
    {
    Public connection()
    {
    Super();
    }

    public void run() {}
    Doc document;
    StreamConnection conn = null;
    InputStream is = null;
    try {}

    Conn = Connector.open (StreamConnection) ("http://ec2-54-248-241-248.ap-northeast-1.compute.amazonaws.com/koperasi-akr-trial/cgi-bin/gw-pinjama...

    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance ();
    docBuilderFactory.setIgnoringElementContentWhitespace (true);
    docBuilderFactory.setCoalescing (true);
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder ();
    docBuilder.isValidating ();
    is = conn.openInputStream ();
    doc = docBuilder.parse (is);
    doc.getDocumentElement () .normalize ();
    List of NodeList = doc.getElementsByTagName ("ID");
    for (int i = 0; i)< list.getlength();="" i++)="">
    Node node = list.item (i) .getFirstChild ();
    listElements.addElement (textNode.getNodeValue ());
    }
    } catch (Exception e) {}
    System.out.println (try ());
    } {Finally
    If (is! = null) {}
    try {is.close ();
    } catch (IOException ignored) {}
    } If (conn! = null) {}
    Try {conn.close () ;}
    catch (IOException ignored) {}
    }} UiApplication.getUiApplication () .invokeLater (new Runnable() {}
    public void run() {}
    _list. SetSize (listElements.Size ());
    subManager.add (_list);
    Screen.Invalidate ();
    }
    });
    }

    }

    ' public void drawListRow (list ListField, Graphics g, int index, int y, int w)
    {
    Your string = (String) listElements.elementAt (index);
    int yPos = 0 + y;
    g.drawLine (0, yPos, w, yPos);
    g.drawText (, 5, 15 + y, 0, w);
    }

    public {get {Object (ListField list, int index)
    {
    Return listElements.elementAt (index);
    }
    public int indexOfList (String prefix, ListField list, int, string)
    {
    Return listElements.indexOf (prefix, string);
    }
    public int getPreferredWidth (ListField list)
    {
    Return Display.getWidth ();
    }
    public final void insert (String toInsert, int index) {}
    listElements.addElement (toInsert);
    }

    ' Public Sub fieldChanged (field field, int context) {}

    }
    }

    Thank you.

    I told you that replace the navigationclick() method where initialize you your listfield

    as I think that changing your code and then answer me

    _list = new ListField()
    {
    protected boolean navigationClick(int status, int time)
    {
      Dialog.inform("hi");
      return true;
    }
    
    public void paint(Graphics graphics)
    {
    graphics.setColor((int) mycolor);
    super.paint(graphics);
    }
    };
    
  • Questions regarding the process of implementing container/control. How "parent of filling" and how to get the actual size of the control?

    I'm writing some UI component custom waterfalls. I went if the document several times and still have two questions:

    1. is it possible to adjust the width of the control to fill the container parent without specifying the number hardcoded in pixel? I see many example of code uses '768' as hardcoded width.

    2. I understand that the 'preferred size' could be ignored in some cases. Is it possible that I can get the actual size of the control on the screen programmatically?

    3. is there any signal was issued when a control container/finish covering all of its child nodes? How do I know what size of a control is finally decided?

    Thank you

    mdodd wrote:

    (1) you can use (QML)

    horizontalAlignment: HorizontalAlignment.Fill
    

    or (C++)

    myControl->setHorizontalAlignment(HorizontalAlignment::Fill);
    

    This will cause control occupy the entire width available to its parent. However, keep in mind you may have to use this property on all containers of parent to the node root to get the width of the full screen.

    As far as I KNOW simon_hain is located on the other two issues.

    ((2) & (3) I just dug around and you find LayoutUpdateHandler would do the job:

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__layoutupdatehandler.html

    mdodd answer on question 1) is correct.

    I can't believe they made a separate category for such a common task. Framework of stunts have had some serious consistency problems, that's what I feel.

    Thanks to all who have contributed to

  • How to get the physical size of the screen?

    Hi all

    How to get the physical width and height of the screen (not resolution) in inches or in centimeters?

    Is there a method to do

    Thank you very much

    Display.getWidth () and Display.getHeight () you will get the number of pixels.

    Display.getHorizontalResolution (); and Display.getVerticalResolution () to get the pixels per meter.  Then by dividing appropriately you can find the actual size.

  • How to get the actual size of control?

    How to get the real size control when the preferred width/height is not defined but control have size which are automatically evaluated (for example contaier with the disposal of the battery)?

    Try the LayoutUpdateHandler: https://developer.blackberry.com/cascades/reference/bb__cascades__layoutupdatehandler.html

Maybe you are looking for

  • Touch screen on the iPhone issues 5 after SW upgrade 9.3.2

    Hello I have an iPhone 5 that I bought just two years ago. The phone worked perfectly despite the fully loaded with applications, images and music. About two weeks ago, I upgraded the software to 9.3.2. Just after that, the touch screen started to wo

  • HP Envy 5530: Printer problems

    Since the upgrade to Windows 10 my 5530 desire won't print files from the computer, or scanning/printing correctly. I have a partial impression / fainted each time. I replaced the ink carts and drivers uninstall/re-installed with the same results. An

  • Panoramic photos

    Hello! It's Photos for Mac. When I installed first of all the pictures, all my photos (or almost all...) were copied from iPhoto, including two panoramic photos.  They are the only ones in this folder.  I tried to do more panoramic photos with my 6 i

  • Satellite P300D - 11 H Bluetooth & Bluetooth FN key does not

    I recently tried to send something to my laptop with bluetooth, but it did not work. So I looked for an update of the last program I had installed the Bluetooth Manager v4. I got a new v5 version but it will not install, they informed that I need to

  • Update of the modules of RAM for my desktop pc

    I want to buy G.Skill Ares RAM for my HP Pavilion G5460uk. The specs are below the RAM Model number