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 07-04-2010, 11:13 PM
Starter Member
 
Posts: 2
Default how to load a html by app.setContent

Hi all,

I have prepared a html file (embedded in javascript codes), and want to load by tab zimlet. I have packaged the html file into the zimlet zip file and have deployed it. However, the zimlet say "Not Found" the loaded html when it was activated.

My codes to load the html file is as follows:

--- com_zimbra_mytabex.js ----

...
com_zimbra_mytabex_HandlerObject.prototype.appActi ve =
function(appName, active) {
switch(appName) {
case this._tabAppName: {
if (active) {

var app = appCtxt.getApp(this._tabAppName);

// load my html file
app.setContent("<iframe src= \"mytestpage.html\" width= \"100%\" height= \"100%\"> </iframe>");

var toolbar = app.getToolbar();
toolbar.setContent("<b>...</b>");

var overview = app.getOverview();
overview.setContent("<b>...</b>");

var controller = appCtxt.getAppController();
var appChooser = controller.getAppChooser();

// change the tab label and tool tip
...

}
break;
}
}
};

----------------- end ------------------

The mytestpage.html has been zipped in the zimlet packages, and I don't know why it still can not be found when zimlet is activated.

On the other hand, when I replaced the parameter "mytestpage.html" to "http://www.baidu.com" in app.setContent(), it works. Does it only support URL, but local file?Are there any ways to load the html file? and how?


Thanks in advance,

Tony
Reply With Quote
  #2 (permalink)  
Old 07-06-2010, 10:53 AM
Zimbra Employee
 
Posts: 187
Default

You need to call this.getResource("mytestpage.html") to get the actual path of the html page.

<iframe src= \""+ this.getResource("mytestpage.html") +"\" width= \"100%\" height= \"100%\"> </iframe>")
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 07-08-2010, 06:43 PM
Starter Member
 
Posts: 2
Default

Quote:
Originally Posted by rrao View Post
You need to call this.getResource("mytestpage.html") to get the actual path of the html page.

<iframe src= \""+ this.getResource("mytestpage.html") +"\" width= \"100%\" height= \"100%\"> </iframe>")
It works, thanks
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.