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

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-07-2008, 06:41 PM
New Member
 
Posts: 4
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
Reply With Quote
  #2 (permalink)  
Old 08-07-2008, 07:32 PM
Former Zimbran
 
Posts: 5,606
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>
Reply With Quote
  #3 (permalink)  
Old 08-08-2008, 11:46 AM
New Member
 
Posts: 4
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
File Type: jpg zimerror.jpg (40.6 KB, 229 views)
Reply With Quote
  #4 (permalink)  
Old 08-11-2008, 01:33 AM
Zimlet Guru & Moderator
 
Posts: 288
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.
Reply With Quote
  #5 (permalink)  
Old 08-18-2008, 01:55 PM
New Member
 
Posts: 4
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
Reply With Quote
  #6 (permalink)  
Old 08-19-2008, 12:52 AM
Zimlet Guru & Moderator
 
Posts: 288
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>
Reply With Quote
  #7 (permalink)  
Old 08-19-2008, 12:05 PM
New Member
 
Posts: 4
Default Working....

Thanks for the help.

Joel
Reply With Quote
  #8 (permalink)  
Old 04-02-2009, 04:39 PM
Project Contributor
 
Posts: 67
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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.