On Thu, Jun 14, 2012 at 4:16 PM, Derrell Lipman <
[email protected]> wrote:

> I am trying to respond to touchstart and touchmove events on a container.
> When I receive a touchstart or touchmove event, I start with
> widget=e.getTarget() and walk up the the layout parent chain with
> widget=widget.getLayoutParent() until I find a container on which I which I
> can operate.
>
> I'm finding, however, that if I add a qx.ui.mobile.list.List() to one of
> my containers, I get a parent of null during that walk, because
> e.getTarget() returns a qx.ui.mobile.container.Composite whose parent is a
> qx.ui.mobile.list.renderer.Default, which has a parent of null. This
> Default renderer is not properly in the layout chain!
>
> If the touchstart begins on a list item, how can I figure out which
> container the list is in?
>
> Thanks,
>
> Derrell
>

I've been thinking about this overnight, and I believe that the current
design is actually flawed. Here's why (from bug 6519 that I just posted)...

qx.ui.mobile.list.renderer.Default is a container, but it, itself, does not
contain anything. A layout parent is the container in which a widget is
contained. It should be possible to walk the widget tree from the root
container to all leaf widgets using _getChildren(), and conversely, it
should be possible to walk the widget tree from any leaf widget up to the
root widget, using _getLayoutParent(). At present, that doesn't work,
because list items have a layout parent (renderer.Default) which does not
have a layout parent. To fix this, list items should have their layout
parent set to be the list in which they are contained. Although the
renderer calls itself a container, it really isn't a container; rather, it
is really just a tool used to lay out the list item within the list.

In qx.Desktop, it is, I believe, always possible to walk the widget tree in
either direction. It should be possible in qx.Mobile as well.

Derrell
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to