Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-17-2009, 09:48 AM
Senior Member
 
Posts: 65
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.
Quote:
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.
Reply With Quote
  #2 (permalink)  
Old 08-18-2009, 01:23 AM
Project Contributor
 
Posts: 127
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
__________________
http://www.seacom.it
Reply With Quote
  #3 (permalink)  
Old 08-18-2009, 08:17 PM
Senior Member
 
Posts: 65
Default

Thank you very much.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.