Results 1 to 3 of 3

Thread: How to show tag immediately

  1. #1
    Join Date
    Oct 2008
    Location
    Thailand
    Posts
    65
    Rep Power
    7

    Default How to show tag immediately

    I create zimlet for automatic add tag to mail.
    I can add tag to mail but there tag was not updated immediately.
    After I reload page there tag was add to mail.

    I found one thing for update tag to mail immediately.
    var view = appCtxt.getCurrentView();
    var msg = view.getMsg()
    ...
    // add tag to mail
    ...
    /// reload msg //
    msg._loaded=false;
    msg.load(msg)l
    But I got some problem.
    I see in msg._bodyPart , in this I saw duplicate object.
    So when I use this mail to follow , the body was duplicate.

    I don't know how to solve this problem or how I update tag to mail immedately.

    Thank for reply.

  2. #2
    Join Date
    Jul 2006
    Location
    Pisa
    Posts
    135
    Rep Power
    9

    Default

    I use this javascript function to add the tag and refresh:

    myzimlet.prototype.addTagToMsg =
    function (doTag, msgOrConvObj, tagName) {
    var tagObj = appCtxt.getActiveAccount().trees.TAG.getByName(tag Name);
    if(!tagObj)
    return;
    var tagId = tagObj.id;
    var axnType = "";
    if (doTag)
    axnType = "tag"; //tag
    else
    axnType = "!tag"; //untag

    var soapCmd = ZmItem.SOAP_CMD[msgOrConvObj.type] + "Request";
    var itemActionRequest = {};
    itemActionRequest[soapCmd] = {_jsns:"urn:zimbraMail"};
    var request = itemActionRequest[soapCmd];
    var action = request.action = {};
    action.id = msgOrConvObj.id;
    action.op = axnType;
    action.tag = tagId;
    var params = {asyncMode: true, callback: null, jsonObj:itemActionRequest};
    appCtxt.getAppController().sendRequest(params);
    };

    Called by

    this.addTagToMsg("tag", msg,"Read");

    Bye

  3. #3
    Join Date
    Oct 2008
    Location
    Thailand
    Posts
    65
    Rep Power
    7

    Default

    Thank you very much.

Similar Threads

  1. Errors in ZBC Logs
    By Chewie71 in forum Zimbra Connector for BlackBerry
    Replies: 3
    Last Post: 03-28-2008, 03:46 PM
  2. can't you help me
    By iwan siahaan in forum Administrators
    Replies: 6
    Last Post: 12-17-2007, 06:53 PM
  3. Tag Weirdness
    By chalkboy in forum Administrators
    Replies: 1
    Last Post: 01-03-2007, 11:40 AM
  4. Error attempting to create a new tag
    By kevindods in forum Installation
    Replies: 2
    Last Post: 11-03-2005, 04:48 AM
  5. Create tag bug in create new filter
    By PotatoBob in forum Developers
    Replies: 3
    Last Post: 10-31-2005, 09:16 AM

Posting Permissions

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