Results 1 to 8 of 8

Thread: Simplest Zimlet…

  1. #1
    Join Date
    Aug 2008
    Posts
    4
    Rep Power
    8

    Question Simplest Zimlet…

    Ok, I have read the pdf on creating zimlets, looked at the other ones as examples and I must not understand something basic. Based on my limited knowledge, should the code below not open a window with website which is listed as the target?

    #####copy below this line#############

    <zimlet name="com_zimbra_myzimlet" version="0.1" description="myzimlet">

    <summary>
    This Zimlet will provide a link to the company website.
    </summary>

    <include> </include>
    <includeCSS> </includeCSS>

    <zimletPanelItem label="MyZimlet">

    <toolTipText>
    Click this to open Website
    </toolTipText>

    <doubleClicked>

    <canvas type="window" width="300" height="300">
    <actionUrl method="get" target="http://www.cnn.com">
    </actionUrl>
    </canvas>

    </doubleClicked>


    </zimletPanelItem>

    </zimlet>


    #######copy above this line##########

    I am using the latest version of the Open Source Edition on CentOS 5 64bit.
    When I double click a small dialog box appears with "preferecnes" and two buttons OK and Cancel.

    Any help will be gratefully welcomed.

    Joel

  2. #2
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    22

    Default

    Try
    Code:
    <zimlet name="com_zimbra_myzimlet" version="0.1" description="myzimlet">
    
    <summary>
     This Zimlet will provide a link to the company website.
    </summary>
    
    <include> </include>
    <includeCSS> </includeCSS>
    
    <zimletPanelItem label="MyZimlet">
    
            <toolTipText>
            Click this to open Website
            </toolTipText>
            
            <userProperties>
                   
                    <canvas type="window" width="300" height="300">
                    <actionUrl method="get" target="http://www.cnn.com" />
                    </canvas>
            </userProperties>
            
    </zimletPanelItem>        
    
    </zimlet>

  3. #3
    Join Date
    Aug 2008
    Posts
    4
    Rep Power
    8

    Default Same error...

    I have attached a screen shot of what I get when clicked. Just for additional knowledge this is a fresh install, so not sure if there are any permission issues I have not dealt with?

    Joel
    Attached Images Attached Images

  4. #4
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    10

    Default

    this is normal that this panel appear. It is the preference panel that is configured by default to pop-up on a double click.
    To open the window with a single click :
    Code:
    <zimlet name="com_zimbra_myzimlet" version="0.1" description="myzimlet">
    <summary>
     This Zimlet will provide a link to the company website.
    </summary>
    <include> </include>
    <includeCSS> </includeCSS>
    <zimletPanelItem label="MyZimlet">
            <toolTipText>
            Click this to open Website
            </toolTipText> 
            <onClick>        
                    <canvas type="window" width="300" height="300">
                    <actionUrl method="get" target="http://www.cnn.com" />
                    </canvas>
            </onClick>     
    </zimletPanelItem>        
    </zimlet>
    For a double click, replace <onClick> by <onDoubleClick>.
    With <onDoubleClick> it will open a new window but you will also get the preferences panel.
    To configure the event for the double click, the best is to use a js file.

  5. #5
    Join Date
    Aug 2008
    Posts
    4
    Rep Power
    8

    Default Still not working...

    tdesorbaix,

    Thanks for the reply...took the above code and now I am not getting anything to happen single or double click? I have to be missing something really simple is the computer plugged in.

    Joel

  6. #6
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    10

    Default

    Tested it.
    There was an error since the beginning with the canvas tag.
    Here is the correction :
    Code:
    <zimlet name="com_zimbra_myzimlet" version="0.1" description="myzimlet">
    <summary>
     This Zimlet will provide a link to the company website.
    </summary>
    <include> </include>
    <includeCSS> </includeCSS>
    <zimletPanelItem label="MyZimlet">
            <toolTipText>
            Click this to open Website
            </toolTipText> 
            <onClick>        
                    <canvas type="window" width="300" height="300" />
                    <actionUrl method="get" target="http://www.cnn.com" />
            </onClick>     
    </zimletPanelItem>        
    </zimlet>

  7. #7
    Join Date
    Aug 2008
    Posts
    4
    Rep Power
    8

    Default Working....

    Thanks for the help.

    Joel

  8. #8
    Join Date
    Nov 2007
    Location
    Detroit, MI
    Posts
    67
    Rep Power
    9

    Default

    To get around this problem, you need to both define an onDoubleClick action in the .xml file and do some JS to override the prefs screen:

    Define a JS handler in the .xml file:
    Code:
    <handlerObject>Com_MyCompany_MyZimlet</handlerObject>
    Define both click and doubleclick actions:
    Code:
    <onClick>        
        <canvas type="dialog" title="My Zimlet" width="800" height="400" />
        <actionUrl method="get" target="https://myhost.com" />
    </onClick>     
    <onDoubleClick>        
        <canvas type="dialog" title="My Zimlet" width="800" height="400" />
        <actionUrl method="get" target="https://myhost.com" />
    </onDoubleClick>
    Setup a stub .js file for the handler that does nothing on the doubleClick event:
    Code:
    function Com_MyCompany_MyZimlet() {
    }
    
    Com_MyCompany_MyZimlet.prototype = new ZmZimletBase();
    Com_MyCompany_MyZimlet.prototype.constructor = Com_MyCompany_MyZimlet;
    
    Com_MyCompany_MyZimlet.prototype.init = function() {
    	if (ZmAssistant && ZmAssistant.register) ZmAssistant.register(new Com_MyCompany_MyZimlet());
    };
    
    // Called by the Zimbra framework when the panel item was double clicked
    Com_MyCompany_MyZimlet.prototype.doubleClicked = function() {
    };
    There is an open bug for this:

    Bug 35377 onDoubleClick in Zimlet XML file pops up two windows

Posting Permissions

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