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 02-19-2009, 08:22 AM
Starter Member
 
Posts: 2
Default singleClicked and doubleClicked not working for zimletPanelItem

Reading through the white-paper, singleClicked and doubleClicked are subsections in zimletPanelItem. This would lead one to believe they could use them in the xml definition like this:

Code:
<zimletPanelItem label="My Label" icon="LabelIcon">
    <toolTipText>Description Here</toolTipText>
    <singleClicked>
        <canvas type="window" width="400" height="600" />
        <actionURL method="get" target="http://www.google.com" />
    </singleClicked>
</zimletPanelItem>
This is not the case. If I do this and single click on the Zimlet in the sidebar, nothing happens. Do I really have to use JavaScript to get this to work? (And, if so, does someone have a simple example)
Reply With Quote
  #2 (permalink)  
Old 02-19-2009, 09:18 AM
Zimbra Employee
 
Posts: 187
Default

singleClicked and doubleClicked should (in theory) work from xml as well. Please open up a bug if it doesnt.
btw, you can check out com_zimbra_ycurrency for an example.

However, almost 99% of the zimlets use javascript simply because its as simple as doing it from xml. Check out zimlets from gallery.zimbra.com for an example
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 02-19-2009, 09:45 AM
Starter Member
 
Posts: 2
Default

Before I open up a bug, can anyone else verify that this doesn't work for them?

Code:
<zimlet name="org_comp_test" version="1.0" description="A Test">
    <summary>
        Testing singleClicked.
    </summary>
    
    <zimletPanelItem label="Single Click">
        <toolTipText>Test</toolTipText>
        <singleClicked>
            <canvas type="window"/>
            <actionUrl method="get" target="http://finance.yahoo.com/currency"/>
        </singleClicked>
    </zimletPanelItem>
</zimlet>
Essentially I have that code in file named "org_comp_test.xml" in a folder named "org_comp_test" in the "_dev" folder to test the zimlet.
Reply With Quote
  #4 (permalink)  
Old 12-07-2009, 01:59 PM
Zimbra Employee
 
Posts: 105
Default

There is currently a bug with <singleClicked> and <doubleClicked> in zimlets. As an alternative, until the bug is fixed, you can process single/double clicked actions in the JS handler object for your zimlet. To do that, implement the singleClicked() and doubleClicked() methods in the zimlet handler object JS file (be sure to include that JS file in your zimlet definition like <include>mytestzimlet.js</include>):

SAMPLE HANDLER OBJECT CODE FROM A ZIMLET JS FILE:


function com_comp_testHandlerObject() {
}

/**
* Makes the Zimlet class a subclass of ZmZimletBase.
*
*/
com_comp_testHandlerObject.prototype = new ZmZimletBase();
com_comp_testHandlerObject.prototype.constructor = com_comp_testHandlerObject;

/**
* This method gets called by the Zimlet framework when the zimlet loads.
*
*/
com_comp_testHandlerObject.prototype.init =
function() {
// do something
};

/**
* This method gets called by the Zimlet framework when single-click is performed.
*
*/
com_comp_testHandlerObject.prototype.singleClicked =
function() {
// do something, like open a window/url
window.open("http://open.my.url.com/");
};

/**
* This method gets called by the Zimlet framework when double-click is performed.
*
*/
com_comp_testHandlerObject.prototype.doubleClicked =
function() {
// do something on double click
};
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.