Hi Derrell,

thanks for your post. I'm using quite similar way except in dblclick
handler. What's happen if I double click to empty area (not list item
in list) and where e.getTarget() will point ? (I think to list
itself).

Correct way for me is something like this:

list.addListener("dblclick", function(e)
{
  if (!(e.getTarget() instanceof qx.ui.form.ListItem)) return;

  // ... now e.getTarget() is list item ...
  // ... my code ...
});

Is this correct or there is better solution?

Cheers
- Petr

2009/3/8 Derrell Lipman <[email protected]>:
> On Sat, Mar 7, 2009 at 6:17 PM, Petr Kobalíček <[email protected]>
> wrote:
>>
>> Hi,
>>
>> how is the best and preffered way to use dblclick event on lists
>> (qx.ui.form.List). I want to do action when user double clicks on list
>> item, but I don't know how to clearly do it.
>>
>> For example my current way is to remember last clicked item and
>> dblclick is using it.
>>
>> So my question is, is there recommended method how to do action for
>> doubleclicked item on list (like celldblclick event in table) ?
>>
>
> Hi Petr,
>
> There's a "dblclick" event you can listen for.
>
> /*
> #require(qx.log.appender.Native)
> #require(qx.log.appender.Console)
> */
>
> qx.Class.define("custom.Application",
> {
>   extend : qx.application.Standalone,
>
>   members :
>   {
>     main : function()
>     {
>       this.base(arguments);
>
>       var list = new qx.ui.form.List();
>       list.add(new qx.ui.form.ListItem("Hello"));
>       list.add(new qx.ui.form.ListItem("world!"));
>       list.add(new qx.ui.form.ListItem("Is"));
>       list.add(new qx.ui.form.ListItem("there"));
>       list.add(new qx.ui.form.ListItem("anybody"));
>       list.add(new qx.ui.form.ListItem("out"));
>       list.add(new qx.ui.form.ListItem("there?"));
>       list.addListener("dblclick",
>                        function(e)
>                        {
>                          alert("Double click on '" +
>                                e.getTarget().getLabel() +
>                                "'");
>                        });
>       this.getRoot().add(list);
>     }
>   }
> });
>
> Cheers,
>
> Derrell
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to