Show two trees with same context structure

Hi,
I'm having problems showing two trees using the same context structure but different data simultaneously.
Here is my context structure:
tree (value node)
- expanded (boolean)
- label (string)
- leaf (boolean)
- recursion (recursion node with ref on tree)
I fill the first two layers of this tree in wdDoInit, the rest is loaded dynamically triggered by the onLoadChildren event.
This setting works fine for one tree. But I have the requirement to set up a second tree using the context structure of the first tree with different data. The problem is both should be shown simultaneously.
What I expected to work is:
1. to wrap the above mentioned structure into a container
2. make the tree a prototype (singleton=false) and
3. instantiate two tree nodes
4. fill both nodes with data
5. bind each with its corresponding ui elements manually
So the "shared" context structure would be:
treeContainer (value node)
- tree (value node, singleton=false)
-- expanded (boolean)
-- label (string)
-- leaf (boolean)
-- recursion (recursion node with ref on tree)
My data mapping code begins with these lines
ITreeContainerElement treeContainerElement =
treeContainerNode.createTreeContainerElement();
treeContainerNode.addElement(treeContainerElement);
ITreeNode treeFactory = wdContext.nodeTree();
which is then called one time for each tree. What happens is that both trees show the aggregated data, so each tree shows the data for both trees. When I use the factory of the element instead
ITreeContainerElement treeContainerElement =
treeContainerNode.createTreeContainerElement();
treeContainerNode.addElement(treeContainerElement);
ITreeNode treeFactory = treeContainerElement.nodeTree();
both trees show the data for the first tree.
I am aware that when I copy the context tree to a different location and rename every value node, e.h. tree2, recursion2 that this will work. But the problem is that the two trees will interact together, e.g. copy branches, and I want to use the typed API since the tree will get quite complex and they have absolutely the same structure.
I guess I'm getting sth. terribly wrong here with my understanding of the context, so any help is appreciated.
Best regards,
Fabian

Hi,
It seems to be that my understanding of the context was terribly wrong. After I traced the behaviour in the debugger I realized that I made one important fault. The datasource of the UI elements should have been bound to the first and second instance of the recursion node container. Therefore the parent node should not be singleton since I access two instances simultaneously.
However, I now separated both trees in the context for the sake of maintainability. I work now with the generic API In order to reuse the functionality.
To determine the correct container I introduced the convention that the tree value node should only contain the recursion node. Then I use the following code to determine the right container:
     private IWDNode getContainer(IWDNodeElement parentElement) {
          IWDNode parentContainer = parentElement.node();
          IWDNodeInfo parentContainerInfo = parentContainer.getNodeInfo();
          boolean isRecursive = parentContainerInfo.isRecursive();
          String childName = null;
          if (isRecursive)
               childName = parentContainerInfo.getName();
          else {
               IWDNodeInfo recursiveNodeInfo =
                    (IWDNodeInfo) parentContainer
                         .getNodeInfo()
                         .iterateChildren()
                         .next();
               childName = recursiveNodeInfo.getName();
          return parentContainer.getChildNode(childName, parentElement.index());
I'm sorry if my question was somehow imprecise and lead into the wrong direction. With the code now working I reckon the question as answered and give you both points for good answers!
Best regards,
Fabian

Similar Messages

  • Two Switches with same MAC+Priority running STP

    Hi
    what will happen if two switch with same MAC-ADDRESS and same STP priority will run STP , how will elect to the root bridge ???? how the STP process will handle this situation?
    thanx

    Well, first off, no two switches (or switchports) will have the same MAC (if they do, you're buying switches from the wrong, very bad place).
    Every port of the switch will have (at least) one MAC of it's own.
    Given the same priority for all switches/bridges on the LAN, the lowest switch/bridge MAC on the LAN will win as the root.
    VLANS take on the MAC of the administrative interface ("CPU"): i.e., xxxx.xxxx.5000, the first port (i.e., fa0/1) is xxxx.xxxx.5001, the second (fa0/2) is xxx.xxxx.5002, and so on
    If you do a "show interface", the MAC / bia is displayed in the second line.
    Good Luck
    Scott

  • Two methods with same name but different return type?

    Can I have two methods with same name but different return type in Java? I used to do this in C++ (method overloading or function overloading)
    Here is my code:
    import java.io.*;
    public class Test{
    public static void main(String ar[]){
    try{          
    //I give an invalid file name to throw IO error.
    File file = new File("c:/invalid file name becasue of spaces");
    FileWriter writer = new FileWriter(file ,true);
    writer.write("Test");
    writer.close();     
    } catch (IOException IOe){
         System.out.println("Failure");
    //call first method - displays stack trace on screen
         showerr(NPe);
    //call second method - returns stack trace as string
            String msg = showerr(NPe);
            System.out.println(msg);
    } // end of main
    public static void showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         String stackTrace = sw.toString();
         System.out.println("Null Ptr\n" +  stackTrace );
    }//end of first showerr
    public static String showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         return sw.toString();
    }//end of second showerr
    } // end of class
    [\code]

    Overloading is when you have multiple methods that have the same name and the same return type but take different parameters. See example
    public class Overloader {
         public String buildError(Exception e){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( e.getClass().getName() )
                   .append( " : " )
                   .append( e.getMessage() ) ;
              return buffer.toString() ;
         public String buildError(String msg){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( msg ) ;
              return buffer.toString() ;
         public String buildErrors(int errCount){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( "There have been " )
                   .append( errCount )
                   .append( " errors encountered.")  ;
              return buffer.toString() ;
    }Make sense ???
    Regards,

  • Two idocs with same idoc number in idx5

    We are using an idoc to file scenario where idocs are bundled using bpm and posted to ftp. here the issue is we are getting two idocs with same idoc number in idx5. due to which the file in ftp is getting overwritten.
    Could anyone suggest me what to do in this regard.

    Hi,
    >>>check your sender system is sending same IDoc twice ?
    if you send the same IDOC twice they both get different numbers as IDOC number is taken from the IDOC num range
    unless you're able to send the same IDOC twice with the same IDOC num somehow
    Regards,
    Michal Krawczyk

  • Two account with same UPN in Active Directory

    Is it possible to have two accounts with same UPN in AD? 
    I'm using Windows Server 2012 R2

    To expand on what Mr X said. Active Directory allows you to assign just about anything to the userPrincipalName attribute, as long as the value is unique. The value of this attribute is generally referred to as the UPN. But you could assign values with no
    "@" symbol, for example, or more than one "@" symbol. Also, Active Directory does not require that any value be assigned. It is an optional attribute.
    If no value is assigned to the userPrincipalName attribute, then the user can use a "default" UPN, which is <sAMAccountName>@<DNS domain name>, where <sAMAccountName> is the "pre-Windows 2000 logon" name of the user
    (the value of the sAMAccountName attribute), and <DNS domain name> is the DNS name of the domain.
    If a user has a value assigned to userPrincipalName that does not match this "default" form, then they can logon with either UPN, as long as no one else has either value assigned to their userPrincipalName attribute. You will note that Active
    Directory enforces uniqueness in the domain on sAMAccountName values.
    If in domain "domain.com" a user has a sAMAccountName of "jsmith" but userPrincipalName "[email protected]", then another user can have userPrincipalName of "[email protected]" (as long as no one else
    has that value assigned to userPrincipalName). They can each logon with their assigned values for userPrincipalName. But the first user can no longer also logon with their "default" value, based on their sAMAccountName, because it is now
    used by someone else. But if you attempt to assign a value to userPrincipalName that is also assigned to another user, you get an error.
    Bottom line, only one person can logon with any given UPN.
    Richard Mueller - MVP Directory Services

  • Let all channels(with same data structure)run one program

    Hello,
    I want to let all channels with same data structure run one program,how can i program it?
    Thanks!

    Hi charleen,
    You're going to need to provide more details for us to help you.  In general "channels" do not "run" programs.  You can, however, run a program which loops over channels, checks their properties, and decides whether to include them in the overall analysis.  What do you mean by "data structure"?
    What do you want to actually happen in the "program"?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Two records with same  key (Infocube)

    Hi,
    I was trying to do, in a update rule, an "IF" condition with two key figures.
    IF Kf1 > Kf2. result = Kf1 else result = Kf2.
    But the data in the source (datamart Infocube to infocube) have tow records with the same characteristics combination (the same keys)and different amount in the keyfigures, then the result of my "if" condition is not the expected because I understood in the infocube only exists one characteristics combination. :S
    I was seeing those records in the manage transaction of the infocube.
    Some reason for this?
    Thanks and regards
    Victoria Leó

    This can happen with parallel loads.  Two rows with same set of Char values but in different packets of the same Request, being loaded at the same time.
    It really shouldn't be an issue - your update rule will make the KF change as desired.  Your queries aggregate KFs based characteristic values, not Dim IDs, so you'll get the totals you expect.
    Here's some more info:
    There is an RSRV Test that lets you check a dimension for a cube to see if multiple DIM IDs exist for the same combination of Chars - <b>Multiple Entries in Dimensions of a (Basis) InfoCube</b>
    Output looks like:
    12:02:24 o'clock on 08/25/2006: Start test run for user PIZZAMAN:)
    Dimension ZFM_C521: DIMID 61,215 and 61,214 have same characteristic values
    Dimension ZFM_C521: DIMID 61,880 and 61,879 have same characteristic values
    Dimension ZFM_C521: DIMID 61,366 and 61,365 have same characteristic values
    Dimension ZFM_C521: DIMID 61,368 and 61,367 have same characteristic values
    12:02:24 on 08/25/2006: Test run for user PIZZAMAN:) completed
    You can run the Correct Error option to have it update fact rows to use one of the DimIDs if you want, but unless you have lots of them, I even wouldn't bother.
    Here's the description of the test:
    <u>Description</u>
    This elementary test recognizes whether there are several lines that have different DIMIDs(dimension table key), but have the same SIDs for the selected dimension table for the InfoCube specified. (This can occur by using parallel loading jobs). This has nothing to do with an inconsistency. However, unnecessary storage space is occupied in the database.
    <u>Repairs</u>
    Since the different DIMIDs with the same SIDs are normally used in the fact tables, they cannot simply be deleted. Therefore, all of the different DIMIDS in the fact tables are replaced by one DIMID that is randomly selected from the equivalent ones. Before a change can be made to the database, the consent of the user is requested.
    DIMIDs that have become unnecessary are deleted in the connection. In doing so, not only are the DIMDs deleted that were released in the first part of the repair, but so are all of those that are no longer used in the fact tables (including aggregates). The consent of the user is again requested before this change is made.

  • Struts- two actions with same path in struts config

    hai
    I am having html:select tag with two options (View And Download) in a form.My form signature is like <html:form action="select">.I mapped two options(View,Download) with same action path.When i click view it doesn't forwards(remains idle) and no error is shown.But i click download it forwards to the appropriate page.If iam having two tags with same action path the second is only working.This problem doesn't comes when iam having one tag alone.
    My code is here:
    -----------Select.jsp----------------
    <html:form action="Select">
    <html:select property="id">
    <html:option value="view">View</html:option>
    <html:option value="download">Download</html:option>
    </html:select>
    </html:form>
    ----------------Struts-config.xml------------
    <form-beans>
    <form-bean name="viewForm" type="ViewForm"/>
    <form-bean name="download" type="DownloadForm"/>
    </form-beans>
    <action-mappings>
    <action path="/Select"
    name="viewForm"
    type="ViewAction"
    input="/Select.jsp">
    <forward name="success" path="/Success.jsp"/>
    </action>
    <action path="/Select"
    name="downloadForm"
    type="DownloadAction"
    input="/Select.jsp">
    <forward name="success" path="/Welcome.jsp"/>
    </action>
    </action-mappings>
    Can i have action tag with same paths like this.If not please provide me a solution

    I have created two success pages.
    I have created two findForward in my ActionClasspublic ActionForward execute(ActionMapping mapping,...............)
    if(a==view)
    return mapping.findForward("success");
    else
    return mapping.findForward("success1");
    ----------------Struts-config.xml------------
    <form-beans>
    <form-bean name="viewdownloadForm" type="ViewdownloadForm"/>
    </form-beans>
    <action-mappings>
    <action path="/Select"
    name="viewdownloadForm"
    type="ViewdownloadAction"
    input="/Select.jsp">
    <forward name="success" path="/Success.jsp"/>
    <forward name="success1" path="/Success1.jsp"/>
    </action>

  • Bootdisk two images with same name n time

    hello,
    I have copied new image on 6509 , s2t54-adventerprisek9-mz.SPA.151-1.SY1.bin but when i do show bootdisk: it shows 2 images with same name .
    6509#show bootdisk:
    -#- --length-- -----date/time------ path
    1     33554432 Apr 19 2013 03:22:44 +00:00 sea_console.dat
    2     99168744 Apr 19 2013 03:28:42 +00:00 s2t54-adventerprisek9-mz.SPA.151-1.SY.bin
    3            0 Apr 19 2013 15:44:26 +00:00 call-home
    4         7209 Jun 11 2013 15:02:10 +00:00 startup-config.converted_vs-20130611-150121
    5         7126 Jun 11 2013 15:37:38 +00:00 startup-config.converted_vs-20130611-153738
    6     33554432 Apr 19 2013 03:46:50 +00:00 sea_log.dat
    7     28856320 Apr 19 2013 04:04:56 +00:00 c6500-fpd-pkg.151-1.SY.pkg
    8     99763688 Nov 19 2013 10:22:30 +00:00 s2t54-adventerprisek9-mz.SPA.151-1.SY1.bin
    9     99763688 Nov 19 2013 10:22:30 +00:00 s2t54-adventerprisek9-mz.SPA.151-1.SY1.bin
    729382912 bytes available (295174144 bytes used)

    Its kind of cosmetic issue. Verify the same using the command dir bootdisk:
    Thanks & Regards,
    Karthick Murugan
    CCIE#39285

  • Unable to monitor two databases with same name on two different hosts

    I have got two databases with same name on two different hosts. I added one database to the list of monitored databases. Now If I try to add the other one , I get the message that the database is already being managed.
    Can't we monitor two databases with same name on two different hosts?

    you can... while saving the target,give a different name.. for eg target-2

  • How to separate two contact with same name

    Hi, anyone knows how to separate two contacts with same name in Contacts?  Actually they are two persons from two gmail contacts with same name but different contact numbers, different emails....etc, but Contacts assume they are same person and merge them as one!

    FG,
    In Lion, you have the File > Duplicate option. You will then have two copies of your document open, and the one on top will have the temporary filename "OriginalFileName copy", and your next responsibility is to File > Save (or Command-S) and rename the duplicate. At this point, you edit the copy's name, to perhaps ...copy 1, or whatever you wish. The document you had open when you initiated the File > Duplicate will still be there on your screen, waiting for you to Close it or continue editing.
    Jerry

  • HT5622 Good day!! I was having two Iphones with same icloud id, later i deleted 1 id from one device, and made 2nd id for this device but same time my old id is stored on other device and i can not change it with another id, can any1 guide me on this issu

    Good day!! I was having two Iphones with same icloud id, later i deleted 1 id from one device, and made 2nd id for this device but same time my old id is stored on other device and i can not change it with another id, can any1 guide me on this issue.

    Log in to icloud.com on a web browser and remove the device from "Find My iPhone"

  • Source XML Structure-Two Nodes with same names

    Hi All,
    I have a strange situation. I am doing a Webservice to RFC scenario. The Third party vendor provided me with the Source XML fro me to create the datatype.
    <?xml version="1.0" encoding="UTF-8"?>
    <Envelope version="01.00">
           <Sender>
                 <Id></Id>
                 <Credential></Credential>
           </Sender>
           <Recipient>
                 <Id></Id>
           </Recipient>
           <TransactInfo transactType="data">
                 <TransactId></TransactId>
                 <TimeStamp></TimeStamp>
           </TransactInfo>
           <Packet>
                 <PacketInfo packetType="data">
                        <PacketId>1</PacketId>
                        <Action></Action>
                        <Manifest></Manifest>
                 </PacketInfo>
                 <Payload><![CDATA[<?xml version="1.0"?>
    <DATA_1>
           <FIELD1></FIELD1>
           <FIELD2></FIELD2>
           <FIELD3></FIELD3>
           <FIELD4></FIELD4>
           <FIELD5></FIELD5>
    </DATA_1>]]></Payload>
           </Packet>
           <Packet>
                 <PacketInfo packetType="data">
                        <PacketId>2</PacketId>
                        <Action></Action>
                        <Manifest></Manifest>
                 </PacketInfo>
                 <Payload><![CDATA[<DATA_2 language="en">
         <FIELD1></FIELD1>
            <FIELD2></FIELD2>
            <FIELD3></FIELD3>
            <FIELD4></FIELD4>
            <FIELD5></FIELD5>
    </DATA_2>]]></Payload>
           </Packet>
    </Envelope>
    As We see Above, There are 2 Nodes named "Packet" at the Same level.
    So When I try to create my datatype in XI based on this XML, XI wont allow to create 2 nodes with same names at the same level.
    We asked the vendor to change the name of the second Packet to Packet_1, they told they cant change it.
    Is there a way in XI to handle this issue??. ie to create 2 nodes with the same name at the same level??
    Thanks,
    Harsh

    Hi,
    Thats's funy, web service is exposed by PI... but it's the thirdparty (client of our web service server) who imposes their choice for structure !! Inversed world.
    Either in Data Type, you define the "Packet" node with an occurence 0..N (or at least 0..2). That will allow you to have the 2 desired nodes by your third-party !
    Or... as your third-party does not want to chance something in their side, that means they probably already have such a web service and so a WSDL file or an XSD of this structure... So ask to them to provide you this WSDL, and you, you will use it as an External Def.
    regards.
    mickael

  • Populate two table with same method

    Hi
    I have two tables in my iview. Both have same column structure but populates data from two different folders.
    The context nodes are also similair only difference being change in the node name.
    I was thinking about one single method which can be used to fill both the tables.
    But I  am having difficulty in passing the arguments to this method.
    Can any1 guide me...
    Regards
    Bobu

    Hi Bobu,
    You can create a method with the two parameters
    1. IWDNode
    2.IWDNodeElement
    You need to call these methods when you want to fill the table. While calling this method you need to send the above two parameters with different Node and Node element references.. We can take referecne of different node with A and B as the node names as
    IWDNode  refA = wdContect.NodeA();
    IWDNode  refB = wdContect.NodeB();
    IWDNodeElemtn refelemA = refA.createElement();
    IWDNodeElemtn refelemB = refB.createElement();
    Thanks,
    Raju Bonagiri

  • Use same report with same database structure to different database server.

    Hi,
    I have standard crystal reports which needs to be copied to another database server.
    The origin database has exactly same database structure with the data base in other server.
    My only question is how to change the connection of the crystal report file from old database server to new one without affecting the linked tables in the report. Would it be possible?
    Note: origin database and new database has same structure, tables and columns but differ in data on it. and both has different server. (MS SQL)
    Thanks,

    Hi Mark,
    Open the report in the CR Designer > select Database option on the top > select Set Datasource location.
    The pane on the top shows the current connection. Go ahead and create a new connection to the target database from the pane at the bottom. Once created, highlight one table from the top, highlight the corresponding table from the bottom pane and click Update. Do this for each table.
    -Abhilash

Maybe you are looking for