Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2012
    Posts
    20

    Default 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 at 10:46 AM.

  2. #2
    Join Date
    Feb 2007
    Posts
    253

    Default

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

  3. #3
    Join Date
    Jul 2012
    Posts
    20

    Default

    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()

  4. #4
    Join Date
    Feb 2007
    Posts
    253

    Default

    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.

  5. #5
    Join Date
    Jul 2012
    Posts
    20

    Default

    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.

  6. #6
    Join Date
    Feb 2007
    Posts
    253

    Default

    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.

  7. #7
    Join Date
    Jul 2012
    Posts
    20

    Default

    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.

  8. #8
    Join Date
    Jul 2012
    Posts
    20

    Default

    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.

  9. #9
    Join Date
    Feb 2007
    Posts
    253

    Default

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

  10. #10
    Join Date
    Jul 2012
    Posts
    20

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •