Sort a context node that has subnodes

I have a context node with cardinatliy 0:1.
It has one subnode, 3 attributes, and a recursive node.
Now, I would like to sort the content of the node by one the three attributes.
How can I do that?

Hi Daniel,
but if the subnode is mapped on the parent, it will have the same 0...1 cardinality - and it won't make sense to sort it.
If perhaps both the parent and subnode have 0...n cardinality but you are only creating one root element - this makes more sense.
Sorting the second/third/nnn level of a hierarchy is difficult - because it is difficult for the user to specify which level they want to sort. I would assume that you'd just make it so that ALL levels were sorted according to whichever criteria you choose.
You could consider representing your data as a table popin's (which would then make it more obvious which level was being sorted) but if your data has n levels of hierarchy this will very quickly become a nightmare of recursive dynamic coding.
As you are no doubt aware, the standard table sorting logic as implemented in CL_WDR_TABLE_METHOD_HNDL does not work for hierarchical tables. (7.01, goodness knows, it might in 7.02)
So I see two options:
I think you would either have to go down the path of creating your own table handler, unfortunately the standard table handler CL_WDR_TABLE_METHOD_HNDL is marked as final - so you couldn't just subclass that and override the sort handling (which doesn't work for hierarchical tables). Instead you'd probably have to re-implement. Then reassign the handler in the WDDOMODIFYVIEW. I remember doing similar sorts of things to implement sorting in WDJ in the early days when the standard handler didn't do all I needed it to do. (i.e. it was sorting by key rather than by text for dropdown by keys).
Or, in the event when you open/display a node, sort the contents according to the state of toggle buttons that you implement in the root node of your hierarchy. When these toggle buttons change state - recursively sort your your entire context.
This means you don't have to mess with the standard table handler, but does give a very non-standard sort implementation.
Good luck, if you have any questions, please do let us know.
Chris

Similar Messages

  • Closing XML node that has been queried closes (crashes?) LabVIEW

    Can someone confirm this observation with closing an XML node that has been searched with the XPath expression of "/" only?  This can be reproduced with the shipped XML example "Query XML Document for a Single Node.vi".  Change the XPath expression to just the forward slash and notice that LabVIEW will close (or crash?) when the VI is executed.
    Thanks

    It doesn't crash until the origional node is closed.  In the example pic it is not unitl it reaches the last "close" does it crash.  I also gets a valid node from the search.  Also, the /* doesn't crash it but the Result XML is not the same.
    I am attempting to teach myself some stuff on XML and XPath expressions and according to WC3:
    / selects the document root (which is always the parent of the document element)
    Anyway, I don't ever plan on using / as a standalone search element but wasn't expecting the crash...
    P.S. & FYI my overall purpose is to parse out data from XML files generated by TestStand.  I need to mine some data...
    Attachments:
    Query XML Document.png ‏40 KB

  • How to find out the descendants of one node that has a nameplace

    hello
    i got a littile trouble when i try to find out the
    descendants of node which has a nameplace,check this sample code
    below please.
    no matter i try to use the node's local name,name,i still got
    a blank.i am confused about that.
    do u people know how to solove that? i really want get that
    descendants of node with nameplace.
    hope u can help me,thx vv much.

    though i have a vicarious solution,but i don't want use it
    right now,i think there would be exist a direct way.
    attach my vicarious solution:
    function getDescendants(xml:XML,des:String="*") {
    var list:XMLList=xml.descendants("*");
    var rlist:XMLList=new XMLList();
    for each (var node:XML in list) {
    if (node.localName()==des || des=="*") {
    rlist+=node;
    return rlist;
    var xl:XMLList=getDescendants(xx,"b");
    trace(xl.length());//output:1
    trace(xl[0].toXMLString());//output:<bb:b
    xmlns:bb="bb.*"/>
    and yes,the final result is what i want,but i don't like its
    course.

  • I am trying to sort out a Macbook that has been subjected to a scam attact.  It has been infected by something called MacScanner and is asking for registration to remove trojans, etc.  I have used 2 programs to try and rmove it unsuccessfully.  Help!!!!!!

    I am trying to sort out a friends macbook that has been subjected to a scam attack.  I am a pc user so am struggling here a bit.  Her machine seems to have been attacked by a program called MacSecurity.  It is telling her that she has a number of viruses, etc and she needs to register to get rid of them.  A **** page keeps trying to open as well.  This type of scam is often found on PC's and is easy to remove.
    After scouring the internet for solutions and came accross 2 programs that are said to remove it - I installed them and neither have worked.  The programs i tried were MacScan 2 and iAntivirus.  Both are free programs. 
    Can anyone help please.

    See this discussion for instructions on removing the trojan.

  • HT201304 oh, my God. Was anything ever so poorly explained as the use of one id for multiple devices? who, where can anyone help sort out the mess that has developed?

    I have used my iphone 4s for over a year. Recently, I bought two ipod touch devices, one for each of my children. While attempting to set up their ipods, even with email advice from apple, we have become utterly confused as to whose apple id is on whose phone/ipod, why some apps automatically appear on two devices but not on the third (it varies). Most worryingly, in app purchases is DISABLED on my iphone but my children can still purchase in-app purchases without my knowledge and have run up bills (fortunately not huge bills). Why would anyone want to allow this???? If I have consciously disabled in app purchases under my apple id on my iphone, why would the default on another device be to allow in app purchases, when using my apple id?
    When setting up my children's apple ids, I wanted them to have their own apple id to avoid this kind of confusion but we got warnings that they were not allowed to have an apple id (presumably too young?) . But they have got their own ipods and should be able to purchase items using itunes cards so why cant they have an independent apple id? And what's the difference between the apple id and the itunes id?
    Is there anyone who can help clear up this mess?

    You have to diasable in app purchases on the device itself, NOT the id.
    If you want in app purchases disabled on the ipods, then you will have to do this on the ipods themselves.

  • Using One Context Node's Info in the Setter of Another

    I am very new to WebUI.
    I have a view.  In its context, it already uses context node BUILHeader .  I need to create a field based on BP_NUMBER info in BUILHeader and place the derived information on the screen.
    I created a new context node that has a field  DerivedValue in it. I think I am supposed to populate it in it's P_Setter.  How do I make he information from BUILHeader available to my setter.
    I think this is simple, but I'm new. so I need a good code example here.
    Thank you .
    ...Mike

    Hi
    Like Amar pointed out if it is possible pleae make sure that the field is also in BUILHeader context nide itself.
    If you want it to be in different context node then
    you can use me->typed_context -> "<context_node name >"
    create an attribute  "typed_context" pointing to the context class.
    "<context_node name >" --- Here you can replace the any of the context node which is present in your view!! you can use
    this anywhere inside the view. Hence you will be able to access other context nodes as well within the purview of the view.
    Thanks
    Abishek

  • Why we need to conver Context  Node data into XML file----Export to Excel

    Hi All,
    Let me clarify my dought........today i have gone through the concept of  "Exporting Context Data Using the Webdynpro Binary cache" in SAP Online Help.
    From the SAP Online Help pdf document, i have found that, the context node data has been converted first in to XML file,after that file had been stored in the web dynpor binary cache...bla....bla.........
    Here my qtn is why they had converted context node data into XML file. With out doing that can not we export context node data to excel file..?
    Regards
    Seshu
    Edited by: Sesshanna D on Dec 19, 2007 7:25 AM

    Hi Sesshanna,
    it is not neccessary to do that but xml has the advantage, that it can be easily transformed into every output format that might occur in later project stages.
    If it's simply about blowing out some Excel, I suggest using an OSS library such as jexcelAPI or Jakarta POI and building the Excel how you need it.
    regards,
    Christian

  • WD ABAP: Recursion Nodes that Repeat Tree Nodes with Embedded Tables ???

    At Rich H's suggestion, I'm posting this here as well as in the blogs.
    Suppose you've got a tree context with a node that has a table embedded under it. (For example, the TREE_WITH_TABLE view of WDR_TEST_EVNT has this kind of context substructure.) Call this node "NODE_WITH_TABLE."
    You now define a recursion node underneath "NODE_WITH_TABLE" and specify "NODE_WITH_TABLE" as the repeated node for this recursion node. Call this recurion node "RECURSION_NODE".
    Lo and behold - the table fills properly when you're on any instance of "NODE_WITH_TABLE", but not when you're on an instance of "RECURSION_NODE".
    I'm hoping that:
    a) I'm doing something wrong;
    OR
    b) There's an easy work-around/alternative I'm not seeing
    OR
    c) SAP will give recursion nodes enough memory to carry any table(s) embedded in the nodes they're repeating.
    'Cause I sure don't want to have to define "n" levels of tree-nodes that have different copies of the same table(s) embedded in them.
    Message was edited by: Armin Reichert

    /people/david.halitsky/blog/2006/08/16/recursion-nodes-that-repeat-tree-nodes-with-embedded-tables-in-wd-abap-not
    Maybe you might want to back out your weblog as it is not really a place to ask these types of questions.  Think of it this way,  if you are allowed to do this type of weblog,  what is stopping any other weblogger.  Hence the weblogs would just be another forum, which I don't think anyone wants. 
    Regards,
    Rich Heilman

  • How to find if a particular context node attribute is changed.

    Hi,
    When a screen is opened, the context node attribs has some values.  On some event, i wanted to check if one particular attribute in the context node has changed.  Is it possible to figure this out.
    (ps note that I need not find if any change has happened to the entire table but only one column (attribute) of the node.  Note that the node has cardinality 0...n.  So there are multiple possible values)
    Thanks in advance.
    regards,
    suresh.

    Hi,
    If you use the [Context change log|http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/f95e42ff93c153e10000000a1550b0/frameset.htm]
    and loop over the result table, looking for a certain attribute name and node name,
    you'll get all the changes of that attribute, for all elements in that node.
    grtz,
    Koen

  • Context node deleted

    Hi Gurus,
    Am new to the Web UI developmoent.
    When i was working on the requirement of getting an existing view from a Zcomponent A to Zcomponent B ,
    the steps which i followed after going through many threads on sdn , was
    u2022Add View to Window: Open the Window node, find your window,
    right click on it and choose Add View.
    u2022Add Component Usage: Open the Component Usages node,
    right click on Component Usage and choose Add Interface View.
    u2022 Added the code in ' WD_USAGE_INITIALIZE ' method.
    No am facing 2 major issues :
    1) when i added the the view in the configuration part, it is throwing an exception which tells -
    Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - There is no node text 'BTORDER' in controller ''. 
    Method:  CL_BSP_WD_CONTROLLER=>DO_CONTEXT_NODE_BINDING 
    Source Text Row:  39
    Initialization of view ZTOP_OPPORT/MyOpptResult of UI Component WCC_SLS_HOME failed
    An exception has occurred Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - There is no node text 'BTORDER' in controller ''. 
    Method:  CL_BSP_WD_CONTROLLER=>DO_CONTEXT_NODE_BINDING 
    Source Text Row:  39
    Cannot display view WCC_SLS_HOME/SalesHome of UI Component WCC_SLS_HOME
    An exception has occurred Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - There is no node text 'BTORDER' in controller ''. 
    Method:  CL_BSP_WD_CONTROLLER=>DO_CONTEXT_NODE_BINDING 
    Source Text Row:  39
    Window MainWindow of UI Component WCC_SLS_HOME cannot be displayed
    An exception has occurred Exception Class  CX_BSP_WD_RUNTIME_ERROR - View ZTOP_OPPORT/MyOpptResult in component WCC_SLS_HOME could not be bound 
    Method:  CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW 
    2) secondly i tried re-creating the existing view which i added in the std Component B window.
    But when i deleted the view n created again it , now i see that the context node of that view in the z component is deleted.
    Deletion of the context node-  is it because i tried deleting the view in the window of the standard component which i added????
    Please let me how do i go about this..

    Hi seema rajjot
    Please check the CTXT class variables , there is a possibility of existing the context node that you created delete that entry manually from there.
    After deleting from there go to CREATE_CONTEXT_NODES method there you will see entry for context node class creation with name CREATE_YOUR CONTEXT NODE NAME, delete that entry manually.
    process to delete the component enhancement.
    Step 1
    First delete the View enahncement, select your view right click on it select delete, while deleting you must be bit catious a pop up will come with standard classes and Z classess there you have to select only Z classes.
    Step 2
    Once View enhancement is deleted delete the Component enahncement.
    if you created any Runtime repository entires or View configuration with your custom fields then first you have to delete those view and runtime repository configuration and then perform the above two steps
    Thanks & Regards
    Raj

  • Dynamic creation of context nodes and ui elements

    Hi,
    I have created context nodes dynamically. And i also want to create UI elements dynamically wherein i want to bind the attribute from the context node to it. For example i want to create a drop down by index and bind one of the attributes in the context nodes that i have earlier created dynamically to it.  I do not know how to get the path to the attribute as i get IF_WD_CONTEXTNODE_INFO when i say get_child_node(). And the IF_WD_CONTEXTNODE_INFO does not have any method where in i can get IF_WD_CONTEXT_NODE from where i can get the path by get_meta_path( )
    Here is the code. The problem is to get the path which is the i/p to cl_wd_dropdown_by_idx=>new_dropdown_by_idx( ) method.
    DATA:
            lo_root_ui_elmnt              TYPE REF TO cl_wd_uielement_container,
            lo_drpdwn_by_idx              TYPE REF TO cl_wd_dropdown_by_idx,
            lo_txt_vw                     TYPE REF TO cl_wd_text_view,
            lo_qstn_node                  TYPE REF TO if_wd_context_node,
            lo_optn_node_info             TYPE REF TO if_wd_context_node_info,
            lv_optn_data_source_name      TYPE string,
            lt_child_nodes                TYPE wdr_context_child_map,
            lo_qstn_el                    TYPE REF TO if_wd_context_element,
            lo_optn_el                    TYPE REF TO if_wd_context_element,
            lv_text                       TYPE string,
            lo_qstn_node_info             TYPE REF TO if_wd_context_node_info.
      FIELD-SYMBOLS:
    *                 <ls_qstn>    LIKE LINE OF wd_this->mt_questions.
                    <ls_child_node>         LIKE LINE OF lt_child_nodes.
      lo_root_ui_elmnt ?= io_view->get_root_element( ).
      lt_child_nodes = wd_context->get_child_nodes( ).
    LOOP AT lt_child_nodes ASSIGNING <ls_child_node>.
       lo_qstn_node = <ls_child_node>-node.
        lo_qstn_el = lo_qstn_node->get_element( index = 1 ).
        lo_qstn_el->get_attribute(
              EXPORTING
                name = 'QUESTION_TEXT'
               IMPORTING
                 value = lv_text ).
        lo_txt_vw =   cl_wd_text_view=>new_text_view( view = io_view ).
        lo_txt_vw->set_text( value = lv_text  ).
        lo_qstn_node_info = lo_qstn_node->get_node_info( ).
        lo_optn_node_info = lo_qstn_node_info->get_child_node( 'OPTIONS' ).
    *    lv_optn_data_source_name = lo_optn_node_info->get_meta_path( withoutcontroller = abap_true ).
    *    CONCATENATE lv_optn_data_source_name '.' 'OPTION_TEXT' INTO lv_optn_data_source_name.
        lo_drpdwn_by_idx = cl_wd_dropdown_by_idx=>new_dropdown_by_idx(
                              bind_texts = lv_optn_data_source_name
                              view       = io_view ).
        lo_root_ui_elmnt->add_child( lo_txt_vw ).
        lo_root_ui_elmnt->add_child( lo_drpdwn_by_idx ).
      ENDLOOP.
    Regards,
    Madhura Lobo
    Edited by: Suhas Saha on Aug 2, 2011 11:04 AM

    Hi Madhura,
    Please check this thread and find Baskaran answer...
    create new child-node in supply-function
    Re: Creating Dynamic Node and Table
    Cheers,
    Kris.

  • MultiColumn sorting of context

    Hello Experts,
    I need to sort the context nodes, based on 2 attributes of the context, one attr in ascending and the other attr in descending. I referred to the link in wiki http://wiki.sdn.sap.com/wiki/display/Snippets/Tablesorterbymultiplecolumns(WebDynproJava). And as per MultiAttributesNodeComparator.java class given in wiki, I am able to sort the context nodes based on  2 attributes but I can only sort both columns either ascending or descending. I need to sort the context element, with first attribute ascending and second attribute descending. I am using Webdynpro 7.1 .
    Replies Awaited...
    Regards
    Priya

    Priya,
    Even I am not sure if you can achive this using the table sorter. I would suggest you to take a look at at Vector. It may be able to give you this functionality.
    @Srinivas:Business logicwise I don't think both the requirements are mutually exclusive. e.g. there can be a table with two columns, Employee Name and Salary. You may want to sort the Names in ascending order and then is the names of the employees are the same then in descending order for the salary. Just a crude example.
    Regards,
    Ajay

  • Web Dynpro & Adobe Interactive Forms - how to update the context node

    Hi Experts,
    I got a WD Component with some context nodes that are mapped to some views and are filled in this views. These context nodes are the dataSource for the Interactive Forms. These forms are embedded in a view by UIElement Interactive Forms.
    My problem is, everytime when I change the structure of the context nodes (i.e. there's an additional attribute necessary), I have to design new forms to get the context nodes linked to the form. My existing forms cannot handle updated context nodes.
    The change in the context node is displayed on web dynpro side, in the dataSource view in UIElement property. But in TA sfp there is the old context node structure displayed without any change (i.e. in number of attributes).
    My forms' layout type is ZCI Layout the interface is based on XML.
    How can I easily update the forms' context node structure without creating new forms every time?
    Thanks in advance,
    Tan

    ok, got it.
    by double clicking on templateSource in UIElement properties the interface can be updated.
    Regards from Murphy's Law.
    Tan

  • Sorting field from subordinate context node

    Hi everybody,
    I have a quite tricky problem:
    I like to create a table view which displays attributes from BuilHeader and from BuilAddress.
    I created therefore a context node BuildHeader in my view and BuilAddress as subordinate context node, linked together by BuilAddressRel in creation assistent von context node BuilAddress.
    When I open the structures view of context nodes, then the parent- and child relationship of both context nodes is visible.
    As it is not possible to insert attributes to a table view from no other context node than the directly assigned one (here BuilHeader), I created a new attribute for the address field, which I wanted do add to the table (the field "REGION"). I created the new field with assistant also and it seems to work.
    Unfortunately the GET_* method of the new attribute was generated false so that I had to change the coding. I fetched the reason from the BuilAddress related entity and selected the region text for the region code. The region text has finally also been displayed but now I have the problem that I cannot sort this added atrribute column for REGION. All other columns can be sorted properly but only the one i need for sorting can't be :-(
    Can anybody tell me if some kind of workarround exists to make this added column also sortable?
    Thanks an best regards,
    Markus

    Hello Markus,
    You might need to enhance the GET_P-method to make the field sortable end also eventually the EH_ONSORT-method as well.
    I have created a thread about this in the past:
    http://scn.sap.com/thread/3270416
    Best regards,
    Thomas Wagner

  • How do I fix or open a corrupted file that has been corrupted by some sort of programmatically email

    How do I fix or open a corrupted PDF file that has been corrupted by some sort of programmatically emailing?
    Please see the following screen shot:
    http://i67.photobucket.com/albums/h292/Athono/pdfproblem_zpsbd9bdc00.png

    Well, it is a pdf file, and it once was a readable one, I suppose.
    It must have data on the hex or binary level that can be retrieved. 
    If necessary, I will have to look into the file format of a PDF file?  Is this documented?

Maybe you are looking for

  • New ALV field is not displaying

    Hi I have added the currency field in the existing ALV report. The final internal table having the currency field and it has value. Curreny field is not displaying in output. Pls help Below is my ALV code for currency. PERFORM FILL_FIELDCAT USING 'WA

  • Browser Support for BPM Workspace for BPM 11g (11.1.1.5.0)

    Hi All, What versions of Mozilla and MS IE supports BPM Workspce? Regards, Sam

  • Ipod classic 30gb white screen-whirring

    hi all. hopefully i can get some help on here although im afraid i already know the answer....ok older ipod classic. 30gb. worked great for yrs. then started freezing up more and more. wouldnt hold a chrarge very long. then one day plugged into kitch

  • No thumbnails or ability to import in Media browser

    Ae CC 13.0, Windows 7 / 64. My Ae media browser shows icons with file names - but no thumbnails - and the right clip import option is greyed out. Same for all file types. File directory and All supported file types are selected in the filter menus. A

  • How can I Display a Image with tiff format in Jpanel?

    How can I Display a CMYK Image with tiff format in Jpanel ? Not in ScrollingImagePanel? Thank you in advance.