i need to copy a text from tree to listbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • lnd
    Indigo Rose Customer
    • Oct 2005
    • 631

    i need to copy a text from tree to listbox

    i need to copy a text from tree to listbox.

    tChildrenOfNode1 = Tree.GetChildren("Tree1", "1.1.1.1");
    result = ListBox.AddItem("ListBox1", tChildrenOfNode1);
  • TJ_Tigger
    Indigo Rose Customer
    • Sep 2002
    • 3159

    #2
    Originally posted by lnd
    i need to copy a text from tree to listbox.

    tChildrenOfNode1 = Tree.GetChildren("Tree1", "1.1.1.1");
    result = ListBox.AddItem("ListBox1", tChildrenOfNode1);

    The Tree.GetChildren action returns a table containing all the children under the specified node. You will need to use a for loop to enumerate the table and add the items to your listbox.

    Code:
    tChildrenOfNode1 = Tree.GetChildren("Tree1", "1.1.1.1");
    --Make sure there are children in the table
    if tChildrenOfNode1 then
       --for each child found add it to the list box with the text as the LB text and the NodeIndex as the data
       for i,v in tChildrenOfNode1 do
          ListBox.AddItem("ListBox1", tChildrenOfNode1[i]["Text"]
    , tChildrenOfNode1[i]["NodeIndex"])
       end
    end
    As a helpful hint, make sure to pay attention to what is returned by the action.

    HTH
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment

    • lnd
      Indigo Rose Customer
      • Oct 2005
      • 631

      #3
      i need only the text in node 1.1.1.1

      i need to read only the text in node 1.1.1.1 in to a variable and put it into a listbox

      Comment

      • TJ_Tigger
        Indigo Rose Customer
        • Sep 2002
        • 3159

        #4
        Originally posted by lnd
        i need to read only the text in node 1.1.1.1 in to a variable and put it into a listbox

        Use the Tree.GetNode action instead.

        Tigg
        TJ-Tigger
        "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
        "Draco dormiens nunquam titillandus."
        Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

        Comment

        • lnd
          Indigo Rose Customer
          • Oct 2005
          • 631

          #5
          i use this code

          i use this code

          tChildrenOfNode1 = Tree.GetNode("Tree1", "1.1.1.1");
          result = ListBox.AddItem("ListBox1", tChildrenOfNode1);

          and get error messeg - must be of type string -

          Comment

          • TJ_Tigger
            Indigo Rose Customer
            • Sep 2002
            • 3159

            #6
            Exactly because the Tree.GetNode returns a table and not a string. You need to specify which column of data you want from the returned table.

            tChildrenOfNode1 = Tree.GetNode("Tree1", "1.1.1.1");
            result = ListBox.AddItem("ListBox1", tChildrenOfNode1.Text, "1.1.1.1");


            Tigg
            TJ-Tigger
            "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
            "Draco dormiens nunquam titillandus."
            Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

            Comment

            • lnd
              Indigo Rose Customer
              • Oct 2005
              • 631

              #7
              Thank you

              Thank you Thank you Thank you....

              Comment

              Working...
              X