Results 1 to 4 of 4

Thread: singleClicked and doubleClicked not working for zimletPanelItem

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    2
    Rep Power
    6

    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)

  2. #2
    Join Date
    Sep 2005
    Posts
    187
    Rep Power
    10

    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!

  3. #3
    Join Date
    Feb 2009
    Posts
    2
    Rep Power
    6

    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.

  4. #4
    Join Date
    Nov 2009
    Posts
    105
    Rep Power
    5

    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
    };

Posting Permissions

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