id/object of selected message(s)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HansMaulwurf
    Junior Member
    • Jul 2012
    • 20

    #1

    id/object of selected message(s)

    Hey,

    how do I get get the current selected message(s), e.g. the id to open a reply-dialog? OXMailHover.actualobject is not defined? :/

    greetings,

    Hans


    edit:
    ok, i found mail_message contains the OXMailObjectCache of the current selected mail. But it only seems to contain the first selection?
    Last edited by HansMaulwurf; 08-06-2012, 10:46 AM.
  • Viktor Pracht
    Open-Xchange Developer
    • Feb 2007
    • 253

    #2
    The set of currently selected mails is stored in a local variable. It can't be accessed from outside of js/mail.js.

    Comment

    • HansMaulwurf
      Junior Member
      • Jul 2012
      • 20

      #3
      Aww, I knew it. Is it possible to rebuild such a structure on my own? I see there is some work with "var mailSelection = new Selection2();"
      But I don't get how to use it to get mailSelection.getSelected()

      Comment

      • Viktor Pracht
        Open-Xchange Developer
        • Feb 2007
        • 253

        #4
        I don't know if you need the selection object, but if not, there is the global event "Selected" which is called with an array of selected object IDs as parameter (not only for mail), and the global variable menuselectedobjects which is automatically updated with that array, as long as the user is in the mail module. Both are ugly hacks and might be replaced with a real API, but until then, they're the only way.

        Comment

        • HansMaulwurf
          Junior Member
          • Jul 2012
          • 20

          #5
          Oh yes, menuselectedobjects works. Is it possible to use menuselectedobjects[0]["id"] to get the whole mailobject to access subject, msg-id and so on? Because sometimes (when I click on an email at the startpage), menuselectedobjects gives only module, id, folderid and hash.

          Comment

          • Viktor Pracht
            Open-Xchange Developer
            • Feb 2007
            • 253

            #6
            No. It is guaranteed to contain only the folder ID and mail ID. Use OXCache.newRequest to retrieve the entire object or the fields you actually need.

            Comment

            • HansMaulwurf
              Junior Member
              • Jul 2012
              • 20

              #7
              Great, newRequest is what I need thank you

              Is it possible to contact you by any IM? Sometimes it would be much faster than here, especially if I need only little hints.

              Comment

              • HansMaulwurf
                Junior Member
                • Jul 2012
                • 20

                #8
                I know, I said this is solved, but is there a way to get to more than one selected object? menuselectedobjects is holding only the first item.

                Comment

                • Viktor Pracht
                  Open-Xchange Developer
                  • Feb 2007
                  • 253

                  #9
                  menuselectedobjects is an array containing the IDs of all selected mails. Why do you think that it contains only the first one?

                  Comment

                  • HansMaulwurf
                    Junior Member
                    • Jul 2012
                    • 20

                    #10
                    You're right, sorry. Stared yesterday too long at the sourcecode. Today everything is working fine and logical. I remember I did this already ... have to save my findings somewhere.

                    Comment

                    Working...
                    X