Align dynamically created components

I use the custom component shown RemoteImageView here to download the images.

How to use the component properly in QML?

I use this code in a loop to create a couple of RemoteImageViews:

var imageView = remoteImageView.createObject(mainContainer);
imageView.url = "urltopicture"
mainContainer.add(imageView);

The component works fine, but all images are stacked on eachother.

I would like to have a presentation which adds them to the side of the other, ultimately use them as buttons.

Let your mainContainer have a StackLayout with orientation LeftToRight.

What you are asking? I guess that's currently a DockLayout

Tags: BlackBerry Developers

Similar Questions

  • Handling dynamically created components qml in C++

    Hey,.

    I dynamically create a qml page by using the following code:

                    onClicked: {
                        var favPage = favPageDef.createObject();
                        nav.push(favPage);
                    }
                    attachedObjects: ComponentDefinition {
                        id: favPageDef
                        source: "FavPage.qml"
                    }
    

    I would now like to manipulate the components in this new page qml in c ++. How to access these components?

    I was able to access the qml components fairly easily if they were created during the initialization of the application, but of course, this isn't the case.

    I discovered what the problem was. I had to do my public AbsractPane in my header file. Then when I created the qml component and calls a function in c ++ it turns out to be a child. Thanks for everyone help well.

  • Help with dynamically created components (turning point properties on or off)

    Hi all! I'm working on an application with a bunch of delegates of control is created dynamically.

    Here's my use case-scenario:

    I do a type app GPA calculator, and instead of hard coding a lot of drop-down lists for students select notes, I created a custom component. According to the documentation, each component created dynamically are destroyed until the parent TI auto is destroyed. ControlDelegate seems to be a better option that you can set the flag to false to make the component to go.  I created a delegate of control that uses the custom of the list drop-down and added a few aliases to give each a name of object on creation. Now, my problem is that I can't understand the correct item call to the property delegateActive set to false to make the element disappear.

    Here is the delegate of the control:

    import bb.cascades 1.2
    
    Container {
        property alias cT : classTitle.text
        property alias oN : obName.text
        property alias dN : dDown.objectName
        property alias cdF : dDown.delegateActive
        property alias dDown : dDown 
    
        topPadding: 10.0
        bottomPadding: 10.0
    
        ControlDelegate {
            id: dDown
            sourceComponent: droDwn
            delegateActive: true
        }
        attachedObjects: [
            ComponentDefinition {
    
                id: droDwn
                GpaDD {
                    ddPro {
                        title: cT
                        objectName: oN
                    }
                }
            }
    
        ]
    
        Label {
            id: classTitle
            text: ""
            visible: false
        }
        Label {
            id: obName
            text: ""
            visible: false
        }
    
        onTouch: {
            console.log(dDown.delegateActive + " " + dDown.objectName)
        }
    }
    

    on the home page, I have the following code to create a new component:

    Page {
        id: gpaCalc
        actions: [
            ActionItem {
                id: addDD
                title: "Add Class"
                imageSource: "asset:///images/add.png"
                ActionBar.placement: ActionBarPlacement.OnBar
    
                onTriggered: {
                    var nn = ddContainer.count();
                    var newDD = defDrop.createObject();
                    newDD.cT = "Class " + [ nn ];
                    newDD.oN = "_" + nn;
                    newDD.dN = "_" + nn;
                    ddContainer.add(newDD);
    
                }
            },
            ActionItem {
                id: remDD
                title: "Remove Class"
                imageSource: "asset:///images/Edit.png"
                ActionBar.placement: ActionBarPlacement.OnBar
    
                onTriggered: {
                    console.log();
                }
    
            }
        ]
        attachedObjects: [
            ComponentDefinition {
                id: defDrop
                DropDelegate {
                }
            }
        ]
        Container {
    
            /* ImageView {
             * horizontalAlignment: HorizontalAlignment.Fill
             * verticalAlignment: VerticalAlignment.Fill
             * imageSource: "asset:///images/rect_overlay.png"
             * opacity: 0.65
             * }*/
            ScrollView {
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
                scrollViewProperties {
                    scrollMode: ScrollMode.Vertical
    
                }
                Container {
                    horizontalAlignment: HorizontalAlignment.Fill
                    verticalAlignment: VerticalAlignment.Fill
                    topPadding: 50
                    leftPadding: 50
                    rightPadding: 50
                    id: ddContainer
    
                    onCreationCompleted: {
                        if (ddContainer.count() < 2) {
                            var nn = ddContainer.count();
                            var newDD = defDrop.createObject();
                            newDD.cT = "Class " + [ nn ];
                            newDD.oN = "_" + nn;
                            newDD.dN = "_" + nn;
                            ddContainer.add(newDD);
                        }
                    }
                    Label {
                        text: "Select Your Grades"
                        textStyle.fontStyle: FontStyle.Normal
                        textStyle.fontWeight: FontWeight.W100
                        verticalAlignment: VerticalAlignment.Top
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle.fontSize: FontSize.XXLarge
                    }
                }
                accessibility.name: "TODO: Add property content"
            }
        }
    }
    

    How can I find the last delegate of control created to define the delegate tag as wrong?

    Any help is appreciated!

    You have so much you need to do it this way?
    Why not just have a placeholder for * each * drop-down list and turn them on and off individually using delegateActive?

  • [Help] Create components dynamically and its id

    Hello guys.

    I need a help

    I know it sounds weird in the title which precedes but I struggled to find a better solution, but can´t understand it.

    I searched the internet but couldn t find a solution to my problem.

    Here's what I have to do.

    I need to create an order of the day. Each cell must accept a new event or remove an existing event

    The idea is to show all the 365 days of the year. It s important and clearer to the user.

    I ve tried to use the < mx:Repeater > to reproduce a 365 times custom component. He succeeded but I can´t find a way to access these components to change its properties.

    As some of them may have an appointment and others not.

    < mx:HBox horizontalGap = "0" >

    < mx:Repeater id = "monthRepeater" >

    < mx:VBox verticalGap = "0" >

    < mx:Box id = "mes_box" borderColor = "#000000."

    borderStyle = "solid".

    borderThickness = "0.5".

    width = "80" >

    < mx:LinkButton label = "{monthRepeater.currentItem.month}" fontStyle = "normal" fontWeight = "normal" / > "

    < / mx:Box >

    < mx:VBox verticalGap = "0" >

    < mx:Repeater id = "daysRepeater" >

    " < visao:CaixaDia id = linktexto =" {daysRepeater.currentItem.day "day_caixaDia"} "labeltexto =" {daysRepeater.currentIndex} "/ >

    < / mx:Repeater >

    < / mx:VBox >

    < / mx:VBox >

    < / mx:Repeater >

    < / mx:HBox >

    Is it possible to use < mx:Repeater > and dynamically create IDS for these components?

    Thank you

    You can access objects created by a Repeater, as if the id was a table, as in the following example:

    
    
      
        
      
      
      
        
          
        
      
    
    

    If this post answers your question or assistance, please mark it as such.

    Greg Lafrance - Flex 2 and 3 certified ACE

    www.ChikaraDev.com

    Training Flex and Support Services

  • Can I dynamically create features on jdeveloper ADF?

    Hello, do you know if it is possible to dynamically generate entities?
    I found examples of dynamically create views, components, etc., but I did find an example or technique to create features of dynamically in the ADF.

    Thanks :)

    Hello

    You must first define a http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/server/EntityDefImpl.html class. It has a protected method then to create an entity to object

    Frank

  • When dynamically created variables are emptied in the sequential process template?

    I have a sequence TestStand 2014 in which I dynamically create and fill many FileGlobal variables in the installation section of my main sequence.  I have it using the TestStand API to read the data in an Excel file (the data consists mainly of thresholds, limits, etc.).  The methodology itself works flawlessy.

    However, there are differences in behavior when using entry points both execution of the sequential process model.  When you use the entry point of execution 'Single Pass', he has no problem in test a DUT after another.  However, when you use the entry point for execution "Test DUT", I encounter the following error after completing of DUT1 and DUT2 testing:

    An error occurred the call 'InsertSubProperty' in 'PropertyObject' of 'NI TestStand 2014 API.

    The name of the element "VariableName" is not valid because it is already in use.

    I interpret this error message means that the variable I am trying to dynamically create the DUT2 track is already present race of DUT1.  I have a few questions about this:

    1. at what point in the sequential process template are dynamically created variables flushed, such as run a further by using 'Single Pass' starts with a clean slate?

    2. is there a reminder that I can substitute such as variables to rinse after each HAD run, allowing me to dynamically create variables on each HAD, during execution using "Test UUT?

    3. better yet, is there a counter of TestStand I can query to determine if I already ran DUT1 when using "Test DUT", such as DUT2 uses the variables that were created dynamically on trail of DUT1?

    Or you can simply use the PropertyExists function as a precondition.

    PropertyExists ("Locals.Foo")

  • How to dynamically create variables of StationGlobals who are LabVIEWIOControl

    I'm looking for a way to dynamically create variables StationGlobals LabVIEWIOControl.  I know not how to create variables through "PropertyObject/SetValXXX", however I have some difficualty create variables that are custom data types.

    Thank you

    Bryon

    Bryon,

    You can use an expression as follows:

    StationGlobals.NewSubProperty("MyVariable",PropValType_NamedType,False,"LabVIEWIOControl",0)

    I hope this helps!

  • dynamically create and destroy the custom menu item

    I have a standard TestStand platform that I use on multiple systems.  On some systems, I have a few sequences of calibration and I would like to have the Update menu to have the RunSequence of these sequences of calibration.  I know how to manually create these menu items, but they are no longer valid for some sequence files.  I would use the sequence SequenceFileLoad to dynamically create menu items and the SequenceFileUnload to destroy these menu items.

    I've played around with the API, but cannot determine the correct path to get to the create and destroy the custom menu items.  Does anyone know how this can be done?

    Thank you

    Matthew

    Yes, see the online help for the members of the following APIs:

    Engine.GetEditTimeToolMenuItems

    EditTimeMenuItems

    EditTimeMenuItem

    Basically, you get a collection of tool using Engine.GetEditTimeToolMenuItems () menu items and then call EditTimeMenuItems.Insert () or EditTimeMenuItems.Remove (). If you insert a you get returns an EditTimeMenuItem object on which you can change the settings.

    In addition, since it has an expression to hide items in menu tool, you need not necessarily to destroy, you can hide them instead.

    Hope this helps,

    -Doug

  • Time of design and of the dynamically created controls

    I have a project written in VC6 as a project of the MFC dialog box. In a particular area, I dynamically create several (the exact number depends on user input) CNiGraphs. There is also a two CNiButtons that were created at design time using the resource editor. The problem I have is that when this dialog box is open, a message appears saying it is an eval version and the control will go off after 5 minutes. After 5 minutes of waiting, the CNiButtons 2 go inactive (black tower), but the continuous CNiGraphs of work. I have a valid license of MStudio 8.1.6, version but it seems that these 2 buttons do not recognize the license. There are also other buttons from the moment of conception of the project, but these have no problem at all. When you create the dynamic creation of the CNiGraphs, give them a valid license string, and I was wondering if there is a problem with the time created and dynamically controls created in the same dialog box to design. Anyone know?

    I don't remember, but I can have created these 2 CNiButtons when I was with only an eval license. (All others were undoubtedly create when I got a full license) Could have an impact on them? I have a vague memory of reading somewhere that DTC create controls to check the license when they are created in the designer and store that info in them license. If this is the case does anyone know an easy way to update the license stored in control? I rather not just delete it and Add again because I would avoid having to redo the tab order (unless someone knows how to easily insert something in the middle of the order of tab instead of having to click through all the controls in the correct order)?

    In addition, I don't know if this would affect anything, but the project was originally built with ComponentWorks 1.0, we were forced to move to MStudio when we met a few bugs in CW, so all controls were originally CW controls which have been converted into control of CNi. I doubt that this is so like everywhere else, we changed during controls is not a problem, but I'm ready to try the suggestions.

    Hi JC,.

    I hope you had a good weekend!  I'm glad to hear that you're back running.  Add the extra button was, in fact, causing update the licensing information for the other buttons, as you can imagine.  After further research, I found that the license information are stored only the form of the control, and if this control doesn't change in any way (or in your case, adding a new project), he sees no reason when compiling to recreate a link to the license.  However, after the change of control and a new, it updates the link between the license information, which solved this problem in your case.

    I hope this helps, JC.  Have a great day!

  • How to dynamically create action item?

    Hi, I want to dynamically create point.

    Before I want to create using qml, but does not seem possible

    http://supportforums.BlackBerry.com/T5/Cascades-development/how-to-create-action-item-of-page-dynami...

    So maybe better to use C++ to create dynamically,

    I'm already try but are still not

    So I have a custom control qml (a Navigation pane)

    name List.qml

    the structure is like this:

    NavigationPane {}

    {Page}

    objectName: myPage

    {Of container

    ....

    }

    }

    }

    How to add action item to this .qml?

    I'm already try that, but failed

    C++ :

    Engine QDeclarativeEngine;

    QDeclarativeComponent component(&engine,QUrl::fromLocalFile("List.qml"));)

    QObject * object = component.create ();

    Page * myPage = object->findChild ("Edit");  Maybe, on that note, I'm wrong implemented? -> not found?

    ActionItem * action1 = ActionItem::create () .title ("first action");

    my page-> addAction (action1, ActionBarPlacement:nBar);

    Remove the object;

    How to create this dynamic Action item?

    Help, please

    Thank you

    Hello

    QML, the object name must be included between "" marks.

    Name of the object of your Page will be:

    objectName: "myPage"
    

    You can reach any CPP QML object like this:

    This excerpt comes from YourProjectName.cpp

    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole
    // application lifetime
    
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
        // set created root object as a scene
        app->setScene(root);
    
    //and here comes the findChild method
    Page* qmlPage = root->findChild("myPage");
    

    After this, you can create any object on the side of C++ QML, as your own code:

    ActionItem* action1 = ActionItem::create().title("First action");
    myPage->addAction(action1, ActionBarPlacement:nBar);
    

    Don't have no need to create a QObejct, or declarative stuff.

  • Dynamically create QmlComponentDefinition objects in the code

    With QML sample:

    // --- main.qml ---Container {    objectName: "fooContainer"    attachedObjects: [        ComponentDefinition {            id: barComponent            source: "Bar.qml"        }    ]}
    
    // --- Bar.qml ---Container {    objectName: "bar"    Label {        text: "FooBar"    }}
    

    I am trying to dynamically create barComponent objects and add them to fooContainer in C++ code.

    So I reference the using fooContainer:

    fooContainer = createdRootObject->findChild("fooContainer");
    

    But how to reference the definition of QML barComponent to use his method createObject()?

    The definition of the element is used to create the object of QML

    To create the C++ object, you need to do:

    qml = QmlDocument::create("asset:///Bar.qml");
    Control *root =  qml->createRootObject();
    fooContainer->add(root)
    
  • dynamically create a database in form 10g

    Hi guys,.

    I got a new requirement, that is to dynamically create a database of blocks and elements...

    How is it possible... ?

    Thank you...

    Ok...

    Thank you

    concerning

    SAI sandeep t

  • iframe on a dynamically created symbol

    Hello

    -J' have a button that creates a dynamically. That's ok

    - then I pass this symbol with TweenMax. It's Ok, I tested it.

    - and finally, I want to load an external URL in this symbol. It does not work.

    The problem is, I think, that I n 't know how to approach this dynamically created symbol.

    This is my code:

    externalURL var = "portfolio/FFD.html";

    var mywrapper = $(sym.createChildSymbol("wrapper","Stage").getSymbolElement ());

    var wrapperMove = TweenMax.to (mywrapper, 2, {css: {top: "2500", left:"0"},ease:Sine.easeOut});}})

    SYM. $("mywrapper") .html ("< iframe src ="+"externalURL + height = 100% width = 100% > < / iframe >");

    Thanks for any help

    Hi Joel

    It worked like that...;

    var mywrapper = sym.createChildSymbol ("wrapper", "Stage");

    var wrapperMove = TweenMax.to (mywrapper.getSymbolElement (), 2, {css: {top: '2500px", left:"0px"},ease:Sine.easeOut});}})

    mywrapper.getSymbolElement () .html ("");

    Somehow it didin'tt as the externalURL variable... don't know why...

    I got to understand it.

    Thanks for your help

  • Get the ID of a dynamically created symbol library, inside another symbol.

    Hello world

    I'm trying to get the id of a dynamic created symbol library.

    When you dynamically create the symbol directly on the stage (or the level of the composition), there is no problem.

    But I can not function when you create the symbol inside another symbol.

    A few examples using 'getChildSymbols()' and 'aSymbolInstances '.

    // USING "getChildSymbols()" /////////////////////////////////////////////////////////////////////////

    ON THE STAGE

    var m_item = sym.createChildSymbol ("m_item", "Stage");

    var symbolChildren = sym.getChildSymbols ();

    console.log (symbolChildren [0] .getSymbolElement () .attr ('id')); / / ok eid_1391853893203

    / / Inside a SYMBOL OTHER

    var m_item = sym.createChildSymbol ("m_item", sym.getSymbol("holder").getSymbolElement ());

    var symbolChildren = sym.getSymbol("holder").getChildSymbols (); / / I use this maybe wrong?

    console.log (symbolChildren.Length) / / returns 0 if can't ID is

    ' USE 'aSymbolInstances "".

    ON THE STAGE

    var m_item = sym.createChildSymbol ("m_item", "Stage");

    console.log(sym.aSymbolInstances[0]); / / ok (I guess) x.fn.x.init [1] 0: #eid_1391854141436 div

    / / Inside a SYMBOL OTHER

    var m_item = sym.createChildSymbol ("m_item", sym.getSymbol("holder").getSymbolElement ());

    console.log (sym.getSymbol("holder").aSymbolInstances [0]); / / Error Javascript in the event handler. Type of event = element

    In this post http://forums.Adobe.com/message/5691824 is written: "mySym.aSymbolInstances will give you a table containing all the 'names' when you create symbols"

    Would be - this only works on the scene / composition level only and not inside a symbol?

    The following methods to obtain the same are indeed possible, but I do not simply want to use them in this case:

    (1) storing a reference to the symbol created in a table and call it later by index.

    (2) giving the elements an ID manually on the creation and use of document.getElementById () thereafter.

    I can't believe that this is not possible. I am probably missing something here.

    Forgive me that I am a newbie using Adobe Edge!
    I really hope that someone can help me here.

    Anyway, thnx in advance people!

    Kind regards

    Lester.

    OK, I solved my problem by using the (simple) code below.
    I guess that 'getChildSymbols()' and 'aSymbolInstances' only works on stage / level of the composition.

    Just thought I'd share this to everyone. Peace!

    var m_item = sym.createChildSymbol ("m_item", sym.getSymbol("holder").getSymbolElement ());

    $.each (sym.$("holder").children (), function (index, obj) {}

    Console.log ($(sym.$("holder").) ([Index] Children()) .attr ('id'));

    });

  • dynamically create and addEventListener on the mouse, click

    Hi, I have 9 buttons on the main stage and each has an incremented instance P0001, P0002, P0003 name...

    I'm trying to dynamically create and addEventListener on mouse click for each call, then the function appropriate when the button is clicked, it is I who does not work, I go about it the wrong way? Thank you

    for (var i: int = 1; i < 10; i ++) {}

    var btn1:String="P000"+i.toString();

    var btn11:Object = btn1;

    var ClickBtn:String="Func"+i.toString();

    btn11.addEventListener (MouseEvent.CLICK, ClickBtn);

    i = i + 1;

    }

    function ClickBtn1(event:MouseEvent):void

    {

    trace ("in it1");

    }

    function ClickBtn2(event:MouseEvent):void

    {

    trace ("in it2");

    }

    ......

    Use:

    for (var i: int = 1; i<10; i++)="">

    This ["P000" + String (i)] .addEventListener (MouseEvent.CLICK, this ["ClickBtn" + String (i)]);

    }

Maybe you are looking for

  • Software downlaod HP Solution Center

    I uninstalled my HP Solution Center software, as fax leave work (prompt gray bar).  When I tried to reinstall, I had the wrong software for my all-in-one printer for Windows 7 64 - bit OS and my Officejet 4500 G510n.  Where can I find the right softw

  • Equium L40-10 X PSL41E keeps freezing - where to find the BIOS?

    Hello I'm new to this forum so please, be gentle. I have a laptop Equium L40-10 XModel number PSL41E-004004AVWorks on Vista 32 bit home My problem is it keeps freezing Ghent I can't do anything, but he re - start. The section of computer problem repo

  • Albums created on macbook iMac

    Photos are shared via iCloud between macbook and iMac, created albums on macbook, how their show on iMac?

  • El Captain does not see any photo on my iPhone iOS 6 9.1

    I connect the iPhone to my Mac 6. photos opens but I don't see any pictures when I go to import... I restart iPhone and Mac, change usb port and bought a new Apple, connecting cable What am I supposed to do?

  • How to lock the frequency of sampling for 5673 and 5663

    Hello In general I try set the transmitter and the receiver.  It seems easy to lock the carrier frequency, but no matter what I do, I seem to have a drift in my sampling frequency (order of 1 ppm). Is the sampling clock in the digitizer 5663 linked t