Results 1 to 3 of 3

Thread: how to load a html by app.setContent

  1. #1
    tony@qin is offline Starter Member
    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    4

    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

  2. #2
    rrao is offline Zimbra Employee
    Join Date
    Sep 2005
    Posts
    187
    Rep Power
    9

    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!

  3. #3
    tony@qin is offline Starter Member
    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    4

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compose mail in HTML broken in 5.0.1 NE
    By manens in forum Installation
    Replies: 11
    Last Post: 05-29-2008, 10:13 AM
  2. failed to read html content in webmail HTML mode
    By Frederick Cheung in forum Administrators
    Replies: 1
    Last Post: 02-24-2008, 05:32 PM
  3. Replies: 4
    Last Post: 11-13-2007, 09:35 PM

Posting Permissions

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