XMLList node items to Class

Hello,
I am using adobe's sample code on how to use a Tree component
and I am trying to make it open a popup TitleWindow on every
selection change. The problem is that I am unable to figure out how
to make the selected item Class and the debugger gives a Type Error
about conversion of XMLList to Class. What am I doing wrong? :(
This is my code:
[Bindable]
public var selectedNode:XML;
public function treeChanged(event:Event):void {
selectedNode=Tree(event.target).selectedItem as XML;
import mx.managers.PopUpManager;
var selectedItem:Class = selectedNode.win;
PopUpManager.createPopUp(this,selectedItem,false);
and on XMLList I have
<node label="Sample Label" win="mmenu"/>
mmenu.mxml exists in my project with a titlewindow to be used
as popup
What am I missing?
the error is like TypeError: Error #1034: Type Coercion
failed: cannot convert XMLList@6d25fd1 to Class.
Thanks in advance...

First, PopUpManager requires a class in that arg, not the
string name of a class. You need to rethink this perhaps. There are
ways to instantiate class instances from a string, try
searching/googling that.
This: "selectedNode.win" returns an XMLList, all e4x
expressions do. Hence the error message when you attempt to assign
it to a var typed Class. Now, used correctly, since that expression
references a text node, it returns text as you expect. I believe
the class is using toString() on the XMLList behind the scenes.
Tracy

Similar Messages

  • How to expand a tree at a specific node/item?

    Hi,
    we have a tree and the nodes/items were binded to context with this code
    lo_nd_nvccmp = wd_context->get_child_node( name = wd_this->wdctx_nvccmp ).
    lo_nd_tree = lo_nd_nvccmp->get_child_node( name = wd_this->wdctx_tree ).
    lo_el_tree = lo_nd_tree->bind_structure( new_item = ls_tree set_initial_elements = abap_false ).
    We want that the tree is expanded at a specific node/item?
    The structure has the field is_expanded of type WDY_BOOLEAN. I think that if the field of the right structure is 'X' then the tree should expanded. How can we find the right structure in the context and change this field to 'X'?
    Code is appreciated.
    Thanks, regards
    Susanne

    Oh, apparently if you try that call right after you create
    the Tree, it will throw a null reference exception. That might
    count as a bug in the flex api...
    If you create a Tree, and give it's dataProvider some xml
    data, and then add it to the stage (addChild), and then you call
    expandItem or expandChildrenOf() right after, you will get a null
    object exception. You have to wait... for something. I don't know
    what.
    I even tried calling _tree.invalidateList() before the
    expandItem, but it will still throw the error...
    I wonder what the Tree needs to wait for? Is this a bug for
    Adobe to fix?

  • No automatic G/L account determination upon SSC items valuation classes

    Hi Experts
    Iu2019m trying to get the G/L expense account on the Purchase Order item for a Standard Service Catalog Item. Iu2019ve assigned a valuation class to valuation class field (ESLA-BKLAS) on the Catalog Header (General data sub-window) and also the same valuation class (RMSTLV-BKLAS) in all Standard Service Catalog Items texts (by choosing the Editor option).
    Ex:
                        SSc item                                    Val class
    A                       Main Service A                                                               SE01                01           H     Service A.01                                                                                SE02
         02                Service A.02                                                                                SE03
                A     H     Service A.02.A                                                                SE05
                B     H     Service A.02.B                                                                SE04
         03                Service A.03                                                                                SE06
    B                       Secondary Service                                                                SE07
         01                Service B.01                                                                                SE08
                A     H     Service B.01.A                                                                SE09
         02           H     Service B.2                                                                                SE10
    Unfortunately, none seems to work (no G/L account is automatically determined by the system)
    Can you help me out?
    Thanks
    Nuno

    I have the same issue where I have maintained the Valuation class values in the Standard Service Catalogue,
    Referenced those SSC items into an outline agreement where I have assigned specific prices... but am required to maintain a Material Group at the Line item level.
    Created a PO that references the Outline agreement.
    Created a service entry that references the Contract services catalogue items...
    ... and regardless of the valuation classes maintained either at the Catalogue level (ESLA-BKLAS) or at the editor level (RMSTLV-BKLAS) the GL that comes into the Service entry document is the one from the Contract line level.
    Any insight as to where I may gain control on this would be greatly appreciated.

  • Configure ITEM FIELDS (Class /SAPSRM/IF_MDF_ITM_DYN_CONTROL) in SRM 7.0

    Hi,
    I am using the class /SAPSRM/IF_MDF_ITM_DYN_CONTROL with the common signature
    IV_OBJECT_TYPE
    IV_FIELD_NAME
    IS_HEADER
    IS_ITEM
    IS_ADD_DATA
    CS_METADATA
    to control my fields within SRM on ITEM LEVEL.
    Question:
    I have one Shopping cart with two positions.
    Is it posiible to configure the Item fields now on a positional basis?
    eg.
    Position 1 Field Description available
    Position 2 Field Description not available
    I debugged the class and changed cs_metadata for fields on position 1 and 2 but this might show no effect.
    Any ideas?
    Thanks and regards
    Andreas

    Problem solved, wrong coding

  • Script to Update Item GL Class Assignments in OPM Inventory?

    We use OPM Inventory in our 11i.5.10CU2 process manufacturing environment. GL Class codes are assigned as categories to items in our OPM item master. We have a need to update the GL Class assignment to a new value for roughly 200,000 items. I've been researching API's to help with this, but unfortunately there are none available for OPM.
    I logged a SR, and OPM development confirmed that there is no API to update OPM items, only to create brand new items. (When using the Create API you set the desired GL Class, but without an Update API there is no sanctioned way to then change it.)
    I traced what happens when one saves a new GL Class category in the forms, and I can see it updating/inserting:
    * ic_item_mst_b
    * gmi_item_categories
    * mtl_item_categories
    Plus, some star schema tables (ENI?), but we don't use any BI products.
    Does anyone have any scripts or experience with updating OPM item category assignments?
    (Does this post belong in another forum? Not sure where it would be seen by the right audience.)
    Thanks, Wolf Moritz

    There are so many things that, in your environment, you might want to check to verify a server build that it is highly unlikely that anyone else does, or would want to do, the same tests.
    You will probably have better luck asking separate questions about how to do some of the specific checks you want to run, and, possibly, how to use colour-coding to highlight in HTML.
    I'll start you off by pointing out that what you make look complex can be done in a much simpler manner. For example, how you get the username from the username environment variable:
    PS C:\Users\Al> $UserName = (Get-Item env:\username).Value
    PS C:\Users\Al> $username | gm | select typename -first 1
    TypeName
    System.String
    PS C:\Users\Al>
    It is good that you are concerned with the type of value assigned, but there is a simpler way that works for all environment variables (all of which are strings):
    PS C:\Users\Al> $UserName = $env:username
    PS C:\Users\Al> $username | gm | select typename -first 1
    TypeName
    System.String
    PS C:\Users\Al>
    This also returns a string, but, in the process, the code is simpler and a bit more intuitive, at least in my opinion.
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • Sales Order Line item characteristics (classes)

    I am not 100% sure what I am talking about but I need to get characteristics for materials on sales orders (line items).  I am told that these characteristics are stored in classes which get assigned to materials via the material master.  I am also told that these characteristics (classes) are created/maintained in transaction CT04.
    My ultimate goal is to create an iDoc similar to LOIPRO01 only include the characteristics for each material.  I imagine that I will be getting the characteristics from a BAPI or FM but I do not know which one.  Also, is there an existing iDoc that contains the fields of LOIPRO01 and also the characteristics?  Right now my plan is to copy LOIPRO01 into a Z iDoc and add the characteristics.
    I did search and I found that people were suggesting BAPI_OBJCL_GETDETAIL and FM CLAF_CLASSIFICATION_OF_OBJECTS.  However, I ran them using the test functionality and they didn't seem to return what I need.
    Regards,
    Davis

    Max,
    Thanks but those give me the details of the characteristics but I need the characteristics of the line items on an order.  I am looking for the way to link up the line item to the characteristics. 
    Davis

  • Post Commitment Item & sponsor class to a group accounts

    Hello,
    In this area, Financial - Public Sector Magement - Funt Management
    Some body knows if it's possible restrict the posting of the commitment Item and the
    sponsor class to a group of accounts?
    Thanks,

    Hi Luis,
    Can you emphasize more on your request? The document chain is this that FI document generates FM entry (except for earmarked funds), so what restrictment are you looking for? If you do not want certain CI used with certain G/Ls (assuming that you do not derive CI, but enter it manually, which is not common), you can always use validations (OB28).
    Regards,
    Eli

  • CollectionNode node item names

    Greetings
    I am attempting to create a custom collection node to share some variables. A simple variable is not a problem, but I am having a problem with a value object. It seems I should be able to set the node name to be the name of the VO and the item name to be the property name and the body to be the property value. No matter what, the item name is "item", so you cannot store more than one property.
    So for a CollectionNode named "testModel",
    cnode.publish(new MessageItem("testInt", 1234), true);
    will give (in Room Console)
    CollectionNode: testModel
    Node: testInt
    Items: item -> body = 1234
    That works fine.
    if I do this:
    cnode.publish(new MessageItem("testVO", 1111, "first"), true);
    cnode.publish(new MessageItem("testVO", 2222, "second"), true);
    I would expect:
    CollectionNode: testModel
    Node: testVO
    Items: first -> body = 1111
    Items: second -> body = 2222
    But I actually get:
    CollectionNode: testModel
    Node: testVO
    Items: item -> body = 2222
    It's not supposed to do that, right?
    Also, docs for MessageItem constructor are wrong and it took a long time to figure out.
    I am using Flex 3.5 and AFCS for player 9.

    Hi,
    You nodeConfiguration for the node I believe is STORAGE_SCHEME_SINGLE_ITEM(which is the default). You should change it to STORAGE_SCHEME_MANUAL. Then you can publish different items on the node and it won't be overwritten. Currently, with single item , the id is always itemID and has only one value i.e the last value.
    On storage scheme as manual , you can have different items with different itemIDs(specified by you) on the same node.
    You can change the node configiuration of this node from the dev console(easier) or programmatically.
    If you are doing programmatically, you should do something like this
    var nodeConf:NodeConfiguration = new NodeConfiguration();
    nodeConf.itemStorageScheme = NodeConfiguration.STORAGE_SCHEME_MANUAL;
    collectionNode.createNode("testing",nodeConf);
    Hope this helps.
    Thanks
    Hironmay Basu

  • Why interface for nodes? but class for UI Elements

    Hi Experts,
                    why in wda ,sap has given interface for nodes and elements ,and class for ui Elements.
    Eg. for using nodes they provide if_wd_context _node
          but for input field they provide cl_input_field
    Any Body Having an idea pls revert asap
    Regards
    Sarath

    hi sarath........
                when the node is being shared between 2 views.............. both the views need to access the same node for updating values. so you need an interface between these two.
               where as for elements you need not have any sharing..... and your element id is unique..... so no problem for that.
               where as in nodes... there might be a node of same name in your view as well as your component controller. so you need an interface.
    ---rergards,
      alex b justin

  • Is a Node item size limited?

    hello!
    I work with an XML file that contains x occurance of an tag (like: <item1>...</item1><item2>...</item2>.. etc).
    Each item is huge. The definition for each item is around 2100 chars (including tag definition, child nodes' data, etc..) .
    I can access the first item's data (by luck?), but for the following items, the last child node's data get truncated when getting it with getNodeValue.
    What is trange, is that the more numeroud items I have, the more the data sent back is truncated early.
    For example:
    if the last child of the last item contains "Hello", the word "hell" is sent back, If I add one more item, its last child nodes data to be sent back will be a kind of "hel", and so on...
    Very strange...
    Is somebody have an idea?
    Is someboady tell me if the nodes have a limitation in size?
    THank you very much!
    Emmanuel

    If you open in a DOM and read this simple xml and try to extract, let's say, the COUNT_DISPLAY tag's value for the TABLE="SECOND", you will see that the data is truncated.
    For the first table, the data of COUNT_DISPLAY is also truncated, but is a little bit longer....
    It's incredible... :-(((
    <?xml version='1.0' encoding='iso-8859-1' ?><DATA><DEFINITION><TABLE NAME="FIRST"><INSERT_DISPLAY><![CDATA[oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo000000]]></INSERT_DISPLAY><INSERT_ACTION><![CDATA[test]]></INSERT_ACTION><UPDATE_DISPLAY><![CDATA[oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo000000]]></UPDATE_DISPLAY><UPDATE_ACTION><![CDATA[test]]></UPDATE_ACTION><DELETE_DISPLAY><![CDATA[]]></DELETE_DISPLAY><DELETE_ACTION><![CDATA[test]]></DELETE_ACTION><COUNT_DISPLAY><![CDATA[oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo000000]]></COUNT_DISPLAY><FIELDS><FIELD><![CDATA[]]></FIELD><FIELD><![CDATA[]]></FIELD></FIELDS></TABLE><TABLE NAME="SECOND"><INSERT_DISPLAY><![CDATA[oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo000000]]></INSERT_DISPLAY><INSERT_ACTION><![CDATA[test]]></INSERT_ACTION><UPDATE_DISPLAY><![CDATA[oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo000000]]></UPDATE_DISPLAY><UPDATE_ACTION><![CDATA[test]]></UPDATE_ACTION><DELETE_DISPLAY><![CDATA[oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo000000]]></DELETE_DISPLAY><DELETE_ACTION><![CDATA[test]]></DELETE_ACTION><COUNT_DISPLAY><![CDATA[oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo000000]]></COUNT_DISPLAY><FIELDS><FIELD><![CDATA[AIRLINECODE]]></FIELD><FIELD><![CDATA[AIRLINENAME]]></FIELD></FIELDS></TABLE></DEFINITION></DATA>

  • Mathscript node access to class data

    I am trying to implement some code which I developed in Matlab in Labview. The code uses functions from the Control and Optimization toolboxes, and looks like it will port easily to Mathscript. I need to parameterize a state-space model of several drugs from several parameter (age, height,weight, gender). I can see how to create an lvclass Patient with a control which uses these four parameters in the private data. I'd like to be able to duplicate the Matlab-style syntax of Patient.Age, etc, by just wiring the Patient object to a Mathscript node.  There doesn't seem to be a way to do this without unbundling first. This seems inelegant, as it requires me to hard-code the names of the private data fields in the mathscript node interface. Is there a simple way to define lvclass data in a class VI's mathscript node?
    Matlab 2008a, Labview 8.6, MacPro OSX 10.5. 

    Hello,
    The MathScript syntactical element you are referring to is a structure.  Unfortunately, we do not have support for structures or cell arrays in MathScript at this time.  It is a limitation we are aware of and investigating for a future release.    You have discovered the workaround.  You will need to unbundle your class data and create separate variables for each member variable in the MathScript node.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • Object Node created inside class Node

    public static class Node
    protected static final Node EXTERNAL= new Node();
    Can somebody do this? Shouldn't you first define a class and then create an object of it?
    Thanks

    Can somebody do this? I suggest you try it and find out.
    Shouldn't you first define a class and then create an object of it?Yes.
    The class is created when you compile the code.
    The object is created when you run the program.
    So there is no problem.

  • I have a listbox with propety nodes "Item names" and "Double click".I'm trying to access the files in the listbox using these nodes but it isn't working. How exactly does Items names work??

    I realise that the first item in the listbox is 0 but how can I open these files in the listbox...I'm very confused!!

    I have attached an example to help you out. Let me know if this is what your looking for.
    Good luck,
    Greg
    Attachments:
    listbox.vi ‏30 KB

  • Target Item from Class

    When I want to target an existing instance on the stage from
    a class I pass in the instance as a parameter as in this example.
    Is this the best way to get at existing instances? It works fine
    but I can imagine it would get difficult if there were too many
    instances to target.

    if you can reference using that, you can remove using:
    MovieClip(root).MyMovieClip.parent.removeChild(MovieClip(root).MyMovieClip);
    and you can add to any displayobjectcontainer.

  • Node [][item] not described in Schema

    hi
    though i read and tried all solutions offered in sdn - i cant solve this problem, and i will be greatfull for any suggestions.
    i'm using nwds Version: 7.0.06.
    i have web service that need no input. when i call it using xmlspy it gives me values in return. with web dynpro i get runtime errors that field item cant be null so i try to create it and pass as parameter. and then get an error that it is not described in Schema.
    context looking like that: RequestOpen->mutzar->item->attriburte vals
    code :
    <i>Request_Open request = new Request_Open();
    wdContext.nodeRequest_Open().bind(request);
    MutzarDT dt = new  MutzarDT();
    Mutzar mut  = new Mutzar();
    mut.setItem(dt);
    ComplexType_Mutzar mutzar = new ComplexType_Mutzar();
    mutzar.setOriginalBean(mut);
    mutzar.setItem(dt);
    request.setMutzar(mutzar);
    request.execute();</i>
    thanks in advanced,
    Roni.

    a new wsdl file was generated for me.
    with the new model, my request was expecting an array. so i sent it:
    <i>MutDT[] mutDtVector = new MutDT[1];
    MutDT mutDt = new MutDT();
    mutDtVector[0] = mutDt;
    request.setMut(mutDtVector);</i>

Maybe you are looking for