Reference code-created child of container by name?

Newbie alert! Been doing flex for about 2 weeks, so please
excuse my cluelessness.
I've got a grid in my main app file, and a script in that
same file adds several rows to the grid (and then items etc to the
rows). Each row is given a unique id upon creation.
Once this is complete, I then want to be able to reference
one of the rows by id, rather than by index. i.e. I want to be able
to do gridx.getChildByName ("Row 1");
However, it seems this sort of thing only works if the id was
hard coded into an MXML tag as opposed to created via ActionSript??
Is that right?
Because this works:
var myRow:GridRow = GridRow ( gridx.getChildAt(1));
and this doesn't:
var myRow:GridRow = GridRow( gridx.getChildByName("Row 1"));
even though I can verify that the id of the row returned by
that first snippet is, in fact, "Row 1".
What I want to avoid is having to refer to the
dynamically-created rows by position as opposed to name.
What am I missing here?
Thanks much for any help!
M.

Hi Scott,
The subform has a nodes collection you can loop though, as you suspected.  If might show up more than you want but you can test the className to see if it is a field and then ui.oneOfChild.className to work out what type of field. So;
for (var i = 0; i < Subform1.nodes.length; i++)
    var n = Subform1.nodes.item(i);
    console.println(n.className + " " + n.name + " " + n.ui.oneOfChild.className);
Hope this helps.
Bruce

Similar Messages

  • Creating a report containing Report Names and associated Groups in XIr3.2

    Hi -- Does anyone know if we have the ability to create a report that contains Report Names and their associated Groups (like LDAP groups)? 
    We actually have Groups associated at the Report Level as well as the Folder level. 
    This functionality did not exist in XIr2.

    I'm inferring you want to report on the CMS repository database, specifically UserGroups and which reports are accessible by those UserGroups.
    That would involve Java SDK coding if you're looking for detailed ACL list information.  You'd need to implement Enterprise Java SDK code to retrieve the InfoObject/SecurityInfo2/Principal information, and create adapter classes to make that information consumable via one of the supported reporting connectivities.
    For this, you'd need experience with both Enterprise Java SDK and supported reporting connectivity APIs (such as POJOs or JavaBeans).
    Sincerely,
    Ted Ueda

  • Need help returning correct name from a code created movie clip

    Hello. I am an AS3 n00b with hopefuly a simple question I am designing a simple game in flash. This code creates an array of movie clips and asigns a picture to each one. It is a map screen. What I need is when I click on one of the created movie clips, I need it to return either the index of the clip in the array or the name of the clip. Basicaly anything I can use to tell them apart in the code. Here is the code:
    import flash.display.MovieClip;
    var MapLoader:Array = new Array();
    var strJPGext:String = ".jpg";
    var intContTileNumber:int;
    var strContTilePath:String;
    var intDistStartX:int = 63;
    var intDistStartY:int = 64;
    var intDistMultiplyY:int = 0;
    var intDistMultiplyX:int = 0;
    var intDistCount:int = 0;
    var MapSquare:Array = new Array();
    for (var i:int = 0; i < 729; i++)
             //var MapSquare:MovieClip = new MovieClip();
            MapSquare.push (new MovieClip());
            MapSquare[i].x = intDistStartX + (intDistMultiplyX * 30);
            MapSquare[i].y = intDistStartY + (intDistMultiplyY * 30);
            MapSquare[i].name = "MapSquare" + i ;
            addChild(MapSquare[i]);
            intContTileNumber = i;
            MapLoader.push (new Loader);
            strContTilePath = intContTileNumber + strJPGext;
            MapLoader[i].load(new URLRequest(strContTilePath));
            MapSquare[i].addChild(MapLoader[i]);
            intDistCount++;
            intDistMultiplyX++;
            if (intDistCount > 26){
            intDistCount = 0;
            intDistMultiplyX = 0;
            intDistMultiplyY++;
    stage.addEventListener(MouseEvent.CLICK, reportClick);
    function reportClick(event:MouseEvent):void
        trace("movieClip Instance Name = " + event.target.name);   
    Now all this works fine, it creates the map and assigns the correct picture and places them in the correct X,Y position and it is the correct grid of 27x27 squares. The problem is with the name, when I click on the movie clip, it returns "Instance2" or "Instance5" or whatever. It starts with 2 and then increases each number by 3 for each clip, so the first one is 2, then 5 then 8 and so on. This is no good. I need it to return the name that I assigned it
    . If I put the code in trace(MapSquare[1]) it will return the name "MapSquare1" so I know the name was assigned, but it isnt returning.
    Please assist
    Thanks,
    -red

    Thanks for the resopnse,
    I know I dont really need the name, I just need the index number of the array, but I cant figure out how to get the index name without specificaly coding for it. That is why in the listener event I use event.target.name because I dont know what movie clip is being clicked until it has been clicked on. Basically when a movie clip is clicked it needs to return which index of the array was clicked.
    I could do it this way:
    MapSquare[0].addEventListener(
      MouseEvent.MOUSE_UP,
      function(evt:MouseEvent):void {
        trace("I've been clicked!");
    MapSquare[1].addEventListener(
       MouseEvent.MOUSE_UP,
       function(evt:MouseEvent):void {
         trace("I've been clicked!");
    MapSquare[2].addEventListener(
       MouseEvent.MOUSE_UP,
       function(evt:MouseEvent):void {
         trace("I've been clicked!");
    ... ect
    but that is unreasonable and it kind of defeats the purpose of having the array in the first place. The code that each movie clip executes is the same, eventualy that index will be passed into a database and the data at that primary key will be retrieved and returned to the program. So I just need to know, when one of those buttons is clicked, which one was clicked and what is its index in the array.
    I am a VB programer and in VB this is very easy, the control array automatically sends its own index into the function when one of the buttons is clicked. It seems simple enough, I just dont know how to do it in action script.
    Thanks again,
    -red

  • Ability to create a collection from a text file containing the names of the pictures

    1 thing that would be very good is the ability to create a collection / quick collection from a text file that contains the names of the picture we want in that collection...
    The reason for that is when i receive an order from a customer typicaly 100-200 different pictures (i'm a wedding photographer), i ask my customer to send me an excel spread sheet with all the name or number of the picture thay want with size & quantity...
    I would like to be able to use that file as an input for a batch job that would add all those files to a collection "customer order" instaid od adding them 1 by 1... it would save me lots of time and would prevent some errors in the order...
    I am currently able to do that with the help of a small utility (Useful File Utility) is the name... with the other RAW converter i use... Bibble

    Well, it is workflow software, true, but it's really focussed on image development. What you're proposing would necessarily make the primary focus be on the business angle, I suspect.
    If you're talking about tools to help customers sit down and pick what they want for manual processing later, that's one thing - but going the rest of the distance to order processing and fulfillment would be out of scope, at least in my view. The reason is that there is just so much room for potential variation in how this gets conducted that I can't see how Adobe could possibly satisfy every pro with one implementation. Even just dealing with all of the possible payment vendors is a hugely problematic area.
    I agree with Don; a third-party plugin via the upcoming SDK might be a distinct possibility, particularly if it were for a "plus services" solution in which the plugin were designed to work with a specific fulfillment vendor. THAT could work quite nicely, and the plugin might even be free (in return for giving the vendor your business, of course).
    In other words, it's not that I see it as a bad idea, it's just that I don't think it belongs in the "core" of LR. This is something that is best dealt with using the SDK so that differences in processes can be allowed for.

  • T-Code for changing the default Exchange Rate reference for creating PO?

    Dear All,
           Can somebody kindly give me the T-Code for changing the default
    Exchange Rate reference for creating PO? Is there a Step by Step
    procedure before changing the default exchange rate?
    Thank you in advance.
    Regards,
    Gopesh

    Hi
    There is not such Tcode to change the default exchange rate from the PO.
    If you want you can confugure the exchange rate in the following path in the IMG,
    SPRO>MM>LIV>Incoming Invoice>Configure How Exchange Rate Differences Are Treated
    Hope it helps you.
    Cheers
    Umakanth

  • AddApplication Method requires public key to create child app. Connection Factory expects child app public key alias to contain app id

    I'm working on implementing the AddApplication method so I can create child apps for my java web application. 
    The AddApplication method schema requires a public key. I'm assuming this must be different than the public key associated with the parent app, as it failed when I tried that, so I've created a new one.
    The ConnectionFactory code that will later access this public key to connect expects the public key to have an alias that is:
    {appid}.keyname
    This creates a chicken/egg scenario. The public key I'm using to create the child app cannot have an alias that includes the app id, as it hasn't been created yet.
    Can someone tell me how other folks are doing this? Or what the intended process is?
    Do I have to create one public key for use in creating the child app, then create another one once I have the child app id, and update the app with it?
    Thanks!

    Hi Joanne,
    I am reviewing the Java SDK source in an effort to understand how they are abstracting the Master/Child methods provided by the HealthVault platform XML API. I will provide an answer as soon as I have it.
    Thanks
    -Sean

  • Deploying libraries containing VI names that are invalid as filenames

    When using "Deploy TestStand System" I get the following error:
    "Error Code:1052
    Could not process LabVIEW VIs. Fix any broken VIs before rebuilding. LabVIEW error:
    C:\TestStand Deployment\Image\target\SupportVIs\Guardian 1000 Status?.vi"
    The problem is apparently the invalid character "?" when attempting to save the VI as a file, but this is the name of the VI in the instrument library for the Quadtech instrument.
    Are there any solutions to this problem or will I have to manually fix all VI names in the library (and be forced to change all references to the VIs as well)?
    Best regards
    Poul Anker Ersly

    Poul,
    The easiest fix is to go to the LabVIEW options and change the SubVI Location from SupportVIs to SupportVIs.llb. This change will put all of the support VIs into an llb which will allow the ? as a valid character.
    The disadvantage of using an llb is that an installer treats it as a single file. This is a problem if you want to create multiple installers containing test VIs.
    -Rick Francis

  • How to create an array containing shared variable values

    Hi
    I am trying to programmatically create an array containing shared variable values and their names.  I can get the variable names by supplying the process name to the get shared variable list function.  How do I then read the value of all the shared variable items returned?
    I have used a data socket open to open a connection to all variables when my program starts.  I then use datasocket read on the opened connections to write to an array.  This works fine until I try to write to one of the variables using a shared variable node.  The variables writes can take from 4secs to 2 mins.  When I remove the shared variable node again all is fine.  Also when I stop using the data sockets, all is fine.
    Is there a conflict between shared variable nodes and data socket writes to the shared variables?
    Can anyone help?  I cannot easily post example code because I am reading the variables from a Wago PFC (PLC) using OPC.

    Hi
    Sorry I forgot to mention the LabVIEW version, its 8.20.  I have tried saving the shared variable node as a sub VI and it makes no difference.
    Attached is a stripped down version of the software.  You will not be able to connect to the IO server because it requires some Wago hardware and software.  You may spot something I have done wrong with the I/O servers, variables or sub VI's.
    The main program that runs is called 'HMI Engine' in the 'Framework' folder.  There may be some other things in the project that aren't used in this example.  I have removed all but the variable connection part of the code.
    I hope someone can help!?
    Thanks
    Mark.
    Attachments:
    HMI Test.zip ‏144 KB

  • JS ScriptUI container.children[name] problem

    Has anyone any experience accessing controls by name?
    The JS Tools reference mentions that a control should have been created using the creation property {name: } syntax, which I obey. Nonetheless, I cannot get the control afterwards.
    I have to use this approach because I'm creating containers on the fly, assigning them names with variables, so the syntax container.children[index] is not a way to go for me.
    Anyone of knowledge out there?
    Regards

    Yeah, one might hear it's a feature not a bug, but I pronounce it a 'bug'.
    Group containers don't return children controls by their name. You have to use panels instead.
    Filed a bug to Adobe, FWIW.

  • Creating dynamic tranparent container

    Hi,
    I have to create a dynamic tranparent container, i have added the following code , but it gives dump.
    Error : The following error text was processed in the system SCC : The ASSERT condition was violated in Screen.
    Kindly help.
    Code:
    *Create container
      DATA: lr_container1            TYPE REF TO cl_wd_uielement_container,
            lr_tranparent_container  TYPE REF TO cl_wd_transparent_container,
            lr_flow_data_tc          TYPE REF TO cl_wd_flow_data.
      lr_tranparent_container = cl_wd_transparent_container=>new_transparent_container(
           height                   = '10'
           width                    = '20'
           id                       = 'TEST'
      lr_flow_data_tc  =  cl_wd_flow_data=>new_flow_data( element = lr_tranparent_container  ).
      lr_container1 ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
      lr_container1->add_child( lr_tranparent_container ).

    Hi,
    I guess that you are getting the dump coz you have missed out on specifying 1 of the layout properties. If the UI element that you are adding on to your layout is a normal element then you need to just fill its LayoutData property. But however if the UI element is a container element (like a Group, TransparentContainer, Tray...) then you need to specify 2 properties:
    Layout & LayoutData
    The property which you specify for the Layout would be inherited by all UI elements that you would embed within your container element.
    Check the code fragment below in which I am dynamically creating a TransparentContainer & embedding a Caption within it. You can try paste it inside your WDDOMODIFYVIEW method & check the results.
    METHOD wddomodifyview .
      DATA: lr_root_container TYPE REF TO cl_wd_transparent_container,
            lr_trans_container TYPE REF TO cl_wd_transparent_container,
            lr_caption TYPE REF TO cl_wd_caption.
      lr_root_container ?= view->get_root_element( ).
      lr_trans_container ?= cl_wd_transparent_container=>new_transparent_container( ).
    "*** Since you are creating an element of type container. You need to specify 2 layout properties:
    "*** Layout & LayoutData. Layout specifies as to how the layout property which would be inherited by
    "*** any elements that are embedded within this container. Whereas LayoutData controls whether the element
    "*** should appear in the same line or next line. This is useful in layouts like Matrix layout.
      cl_wd_flow_layout=>new_flow_layout( container = lr_trans_container ).
      cl_wd_flow_data=>new_flow_data( element = lr_trans_container ).
      lr_caption ?= cl_wd_caption=>new_caption( text = 'This is my caption!' ).
      cl_wd_flow_data=>new_flow_data( element = lr_caption ).
    "*** Embed the created caption within our TransparentContainer
      lr_trans_container->add_child( the_child = lr_caption ).
    "*** Add the created TransparentContainer as a child of ROOTUIELEMENTCONTAINER
      lr_root_container->add_child( the_child = lr_trans_container ).
    ENDMETHOD.

  • E-Recruitment -- Reference Code for Job Posting

    When I create the Job Posting, SAP E-Rec create a system generated reference code. Can this code be changed / customizied?.

    Hello Vishal,
    there is a BAdI which you can use to implement your logic for generation a reference code. The name of this BAdI is HRRCF00_GET_EXT_CODE. Just create an implementation according to your needs and activate it.
    Kind Regards
    Roman

  • Creating Symbol Instances containing a dynamically set image - Help Needed

    I'm working on a site prototype that has many rollover images in the navigation. Each image is unique, but the rollover and rollout code is identical. I'm trying to create a single symbol that can be used for all of the rollovers, but need some help figuring this out, as it will significantly speed up my work.
    I think the pseudocode would work like this:
    Create a symbol that contains a default rollover image.
    In the symbol, add the rollover and rollout code. This adjusts transparency from 0 -> 100 and back.
    Create instances of the symbol over each item in the nav.
    For each instance, set a variable containing the name of the rollover image to be used.
    In that symbol instance, get the variable value.
    In that symbol instance, use the image name in the variable to replace the default image.
    Question: How do I make step 4-6 work? I have 1-3 working smoothly.P.S. My last dev work was waaaaay back with Director, PHP and ColdFusion. I still get basic principles such as using functions, objects, instances, inheritance etc, but the language has changed. And I have very very little experience with the DOM.
    Appendix: How I'm Doing This Manually
    There's a background image of the nav showing all of the unselected states
    Each item in the nav has a corresponding rollover image, in a series of elements layered on top of nav element. Each rollover has opacity initially set to 0%.
    Each image element has rollover, rollout and click triggers. Rollover and rollout triggers are identical for each. There's also a little more code with rollout that provides a quick fade. This means lots of copying identical code. I hate to think about having to change any part of that code.
    Thanks! Chassy

    Hi there,
    Perhaps a more simple solution would be to set up 1 global function that handles over/out states for all your buttons. On mouseenter/mouseleave of each button you would call this function to fade in/out your rollover graphic.
    Example:
    http://www.timjaramillo.com/code/edge/rollover4_multiple_btns
    Source:
    http://www.timjaramillo.com/code/edge/_source/rollover4_multiple_btns.zip
    Code on Stage.compositionReady (note there are btn symbols called btn_1, btn_2, btn_3, and all have an over state called "over" in them):
    var array_btns = ["btn_1", "btn_2", "btn_3"];// array to hold all your btns
    function setup_btns()
              // iterate through array_btns, add "mouseenter" and "mouseleave" for all
              for (var i=0; i<array_btns.length; i++){
                        // hide "over" state initially
                        sym.getSymbol( array_btns[i] ).$("over").hide();
                        sym.$( array_btns[i] ).mouseenter({obj:array_btns[i]}, function(e){
                                  var btn = e.data.obj;
                                  sym.getSymbol(btn).$("over").fadeIn(500);// show "over" graphic
                        sym.$( array_btns[i] ).mouseleave({obj:array_btns[i]}, function(e){
                                  var btn = e.data.obj;
                                  sym.getSymbol(btn).$("over").fadeOut(200);// hide "over" graphic
    setup_btns();

  • The contained field name "ADTAGR" does not exist in any of the database tab

    hı all
    how can l  solved thıs problem
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
    not caught in
    procedure "PUT_QMFECAT" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    An Open SQL clause was specified dynamically. The contained field name
    "ADTAGR" does not exist in any of the database tables from the FROM clause.
    Information on where terminated
        Termination occurred in the ABAP program "SAPDBZQNQ" - in "PUT_QMFECAT".
        The main program was "ZQMR_BILDIRIM ".
        In the source code you have the termination point in line 732
        of the (Include) program "SAPDBZQNQ".
    Error occurred during batch input processing
        The termination is caused because exception "CX_SY_DYNAMIC_OSQL_SEMANTICS"
         occurred in
        procedure "PUT_QMFECAT" "(FORM)", but it was neither handled locally nor
         declared
        in the RAISING clause of its signature.
        The procedure is in program "SAPDBZQNQ "; its source code begins in line
        715 of the (Include program "SAPDBZQNQ ".
    FORM put_qmfecat.
      DATA: l_tab_fields  TYPE  rsfs_tab_fields.
      DATA: l_ds_clauses  TYPE  rsds_where.
    Dynamische Feldselektion
      MOVE 'QMFECAT_C' TO l_tab_fields-tablename.
      READ TABLE select_fields WITH KEY l_tab_fields-tablename
                                    INTO l_tab_fields.
      IF sy-subrc <> c_rc00.
        CLEAR l_tab_fields.
      ENDIF.
    Dynamische Selektionskriterien
      MOVE 'QMFECAT' TO l_ds_clauses-tablename.
      READ TABLE dyn_sel-clauses WITH KEY l_ds_clauses-tablename
                                 INTO l_ds_clauses.
    DB-Zugriff
      >>>>> SELECT (l_tab_fields-fields) FROM qmfe
      INTO CORRESPONDING FIELDS OF TABLE qmfecat_tab
       WHERE qmnum  =  rqmqmel-qmnum
       AND kzloesch =  space
       AND (l_ds_clauses-where_tab)
       ORDER BY PRIMARY KEY.
    regard sinan
    Edited by: eyup_sinan on Jan 6, 2012 3:21 PM
    Edited by: eyup_sinan on Jan 6, 2012 3:30 PM

    You seem to have made a copy of the standard program. You'll have to make sure that you are handling this field correctly in your code.
    Rob

  • How to do create data type for coulmn name as QS$FGD .

    hi ,
    In my database i have a column as QS$FGD.
    How do i map it in XI , since $ is not accepted when u create a data type.
    One way is to give alias at the databse level for the column . is there any other way to slove it .
    Thanks
    amit

    Hi Amit,
            Were you able to solve your issue? I'm facing the similar issue now. My DB table contains field names with '.' i.e. say xyz.abc. How to solve this??
    I feel SP could be an alternative??
    Thanks,
    Hussain.

  • Unable to create the type with the name 'MSORA'. (Microsoft.SqlServer.ManagedDTS)

    I am attempting to use the Integration Services Import Project Wizard within Microsoft Visual Studio and am getting this error
    Unable to create the type with the name 'MSORA'. (Microsoft.SqlServer.ManagedDTS)
    upon Import.
    Can anyone shed some light for me on this cryptique error message?
    Thanks for your review and am hopeful for a reply.

    If you have the SSIS and SSDT (BIDS) installed then
    I believe the DTS assemblies got derigistered, a typical outcome of corrupted software, so a full re-install would be the best option. VS +SQL Server  + more
    Otherwise, as a quick fix try to
    reference the SSIS assemblies, like Microsoft.SQLServer.ManagedDTS.dll + more.
    They are by default in C:\Program Files\Microsoft SQL Server\<number>\SDK\Assemblies.
    Arthur
    MyBlog
    Twitter

Maybe you are looking for

  • Dunning Notice per Individual Line Items.

    We have a dunning requirement to print individual dunning notice per line item.  In fact, SAP standard form will give support for all open items of respective customer.  Recently, we have developed a form in such a way that it will consider only one

  • Confiemed qty in Afru table

    Hi expert    How to get the cancelled operations in the afru table    since i need to calculate the confirmed qty Regards

  • How to set the bit length of the RSA key in ILOM?

    It is possible to generate new SSH keys for the ILOM. set /SP/services/ssh generate_new_key_type=rsa set /SP/services/ssh generate_new_key_action=true I noticed that the default length is 1024 bit. How to define a key with 2048 bits?

  • ITunes wont install or uninstall!!

    I have an ipod touch 2nd gen and an ipod shuffle 2nd gen. But i am unable to use them with itunes. I then went to uninstall itunes but it doesnt work. the problem seems to be related to the CD Configuration folder located in the program files part of

  • Trouble with a PDF opening correctly from a link

    When I click the link to a certain pdf on a web page, a new window opens but I get the error message "The file is damaged and could not be repaired." I click OK, then close that window. I go back to the link, click on it again, and sometimes the pdf