Re: List Item renderer Click event finds a component in its way

2018-07-03 Thread Carlos Rovira
gt; 
> wrote:
> >
> > Hi Yishay,
> >
> > thanks for let me know about it. I'm playing with it but I
> didn't get
> > to
> > work.
> > The case is that maybe List component is not ready for this yet.
> >
> > * event.currentTarget seems not exists in ItemRenderers
> > * I can use "itemClicked" event in a MXML List (I think is not
> set the
> > metadata and the rest of wiring)
> > * List change event doesn't work as well.
> >
> >  Hope you or other could point me to a more elegant solution
> since
> > right
> > now, since for me the actual solution is a hack that must be
> converted
> > to
>     >     something more final.
> >
>     > Thanks
> >
> >
> >
> > 2018-07-02 16:38 GMT+02:00 Yishay Weiss  >:
> >
> > > Take a look at ItemRendererMouseController.handleMouseUp() in
> > Basic. It
> > > uses currentTarget.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 
> > > From: carlos.rov...@gmail.com  on
> behalf of
> > > Carlos Rovira 
> > > Sent: Monday, July 2, 2018 5:27:08 PM
> > > To: dev@royale.apache.org
> > > Subject: List Item renderer Click event finds a component in
> its way
> > >
> > > Hi,
> > >
> > > what's the best way to handle a click event in a List when the
> Item
> > > renderer has some components that can interfere in the click
> event?
> > >
> > > I have an icon and a Label in the item renderer and if I click
> on
> > one of
> > > those "event.target" is logically set to this components.
> > >
> > > How to make "event.target" always resolve to the
> item-renderer, even
> > if I
> > > click in the label or the icon.
> > > If the label or the icon has a click event, then clicking on
> one of
> > those
> > > components should call it's own click handler, but if nothing
> is set
> > up, a
> > > click in any part of the renderer should call the list click
> event
> > handler.
> > >
> > > In JS I can set pointer-events : none for sub components in
> item
> > renderers
> > > but does not seems the best way to handle this
> > >
> > > thanks
> > >
> > > --
> > > Carlos Rovira
> > > https://na01.safelinks.protection.outlook.com/?url=
> > http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%
> 40adobe.com%
> > 7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178de
> > cee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%
> 2BHBytWFauyvIL%
> > 2BloI7dxNOF6lew%3D=0
> > >
> >
> >
> >
> > --
> > Carlos Rovira
> > https://na01.safelinks.protection.outlook.com/?url=
> > http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%
> 40adobe.com%
> > 7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178de
> > cee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%
> 2BHBytWFauyvIL%
> > 2BloI7dxNOF6lew%3D=0
> >
> >
> >
>
>
> --
> Carlos Rovira
> https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%
> 7Cc01361909eb24a3e70e908d5e0bbbec1%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C0%7C636662019355371776=cv0ARXbINuhO3IwWt1RDf8UA789U9z
> n7gcerSsncUGA%3D=0
>
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: List Item renderer Click event finds a component in its way

2018-07-03 Thread Alex Harui
> to
> something more final.
>
> Thanks
>
>
>
> 2018-07-02 16:38 GMT+02:00 Yishay Weiss :
>
> > Take a look at ItemRendererMouseController.handleMouseUp() in
> Basic. It
> > uses currentTarget.
> >
    >     >
    > >
    > >
    > >
> >
> >
> > 
> > From: carlos.rov...@gmail.com  on behalf of
> > Carlos Rovira 
> > Sent: Monday, July 2, 2018 5:27:08 PM
> > To: dev@royale.apache.org
> > Subject: List Item renderer Click event finds a component in its way
> >
> > Hi,
> >
> > what's the best way to handle a click event in a List when the Item
> > renderer has some components that can interfere in the click event?
> >
> > I have an icon and a Label in the item renderer and if I click on
> one of
> > those "event.target" is logically set to this components.
> >
> > How to make "event.target" always resolve to the item-renderer, even
> if I
> > click in the label or the icon.
> > If the label or the icon has a click event, then clicking on one of
> those
> > components should call it's own click handler, but if nothing is set
> up, a
> > click in any part of the renderer should call the list click event
> handler.
> >
> > In JS I can set pointer-events : none for sub components in item
> renderers
> > but does not seems the best way to handle this
> >
> > thanks
> >
> > --
> > Carlos Rovira
> > https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%
> 7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%2BHBytWFauyvIL%
> 2BloI7dxNOF6lew%3D=0
> >
>
>
>
> --
> Carlos Rovira
> https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%
> 7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%2BHBytWFauyvIL%
> 2BloI7dxNOF6lew%3D=0
>
>
>


-- 
Carlos Rovira

https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%7Cc01361909eb24a3e70e908d5e0bbbec1%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636662019355371776=cv0ARXbINuhO3IwWt1RDf8UA789U9zn7gcerSsncUGA%3D=0




Re: List Item renderer Click event finds a component in its way

2018-07-03 Thread Carlos Rovira
Hi,

just solved the problem with this code in JewelExample changing to "CHANGE"
event:

import vos.NavigationLinkVO;
private function changeHandler(event:Event):void
{
var item:NavigationLinkVO = (event.target as Navigation).selectedItem as
NavigationLinkVO;
main.showContent(item.href);
drawer.close();
}

I think is more elegant than using MouseEvent, even probably the right way
to go.

But I think the problem it arise with MouseEvents, target, currentTarget
and itemClicked is still there. The problems I see are:

1.- itemClicked (and others of this kind) is not exposed in MXML for Lists,
Should this be added? If not maybe is hard to use it right?
2.- currentTarget in List elements is null, I think this is not right

I tried multiple ways to workaround this but nothing worked with MouseEvent
- Click handler in List, so I think others with better knowledge of how
events work and the underling components and implementation should take a
look at this and try to see if there's a problem as I say or maybe is me
missing something

btw, Drawer component is mostly done, although I want to do some more
things to make it more complete :)

thanks



2018-07-03 10:05 GMT+02:00 Carlos Rovira :

> Hi Alex,
>
> taking into account the code from JewelExample I just posted. This code:
>
> private function clickHandler(event:MouseEvent):void
> {
> var renderer:INavigationRenderer = event.currentTarget as
> INavigationRenderer;
> trace(renderer);
> }
>
> shows a trace = null, whatever place you click on the renderer (in the
> subcomponents or directly in the renderer). event.target is right but only
> in the renderer as expected.
>
> So it seems currentTarget is not working right at least in List component.
>
> Thanks
>
>
> 2018-07-03 4:10 GMT+02:00 Alex Harui :
>
>> If event.currentTarget is not working, we need to make it work.  That is
>> the recommended way to handle bubbling of events.  The browsers and Flash
>> work that way so folks will expect it to work.
>>
>> The List's change event is not a bubbling event.  Only interaction events
>> like Mouse and Keyboard events should bubble.  There were lots of folks
>> overusing bubbling in old Flex code, but in Royale we should discourage
>> it.  Instead each layer of the DOM should dispatch an appropriate
>> higher-level semantic event.  IOW, while you can "click" anywhere in an
>> item renderer, logic in the item renderer gets to determine whether to
>> dispatch a higher-level semantic event like "itemClick" and "itemClick"
>> events should not bubble.  Some higher-level layer might listen for
>> "itemClick" and turn it into "rowClicked" for a DataGrid, and even
>> higher-level might turn that into "change" or "selectionChange".
>>
>> So, IMO, instead of trying some new mechanism, it would be better to
>> understand why currentTarget is not working for Mouse/Keyboard events, or
>> add the code to propagate semantic events up the parent chain.
>>
>> My 2 cents,
>> -Alex
>>
>> On 7/2/18, 2:44 PM, "carlos.rov...@gmail.com on behalf of Carlos
>> Rovira" 
>> wrote:
>>
>> Hi Yishay,
>>
>> thanks for let me know about it. I'm playing with it but I didn't get
>> to
>> work.
>> The case is that maybe List component is not ready for this yet.
>>
>> * event.currentTarget seems not exists in ItemRenderers
>> * I can use "itemClicked" event in a MXML List (I think is not set the
>> metadata and the rest of wiring)
>> * List change event doesn't work as well.
>>
>>  Hope you or other could point me to a more elegant solution since
>> right
>> now, since for me the actual solution is a hack that must be
>> converted to
>> something more final.
>>
>> Thanks
>>
>>
>>
>> 2018-07-02 16:38 GMT+02:00 Yishay Weiss :
>>
>> > Take a look at ItemRendererMouseController.handleMouseUp() in
>> Basic. It
>> > uses currentTarget.
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > 
>> > From: carlos.rov...@gmail.com  on behalf
>> of
>> > Carlos Rovira 
>> > Sent: Monday, July 2, 2018 5:27:08 PM
>> > To: dev@royale.apache.org
>> > Subject: List Item renderer Click event finds a component in its way
>> >
>> > Hi,
>> >
>> > what's the best way to handle a click event in a List when the Item
>> > renderer 

Re: List Item renderer Click event finds a component in its way

2018-07-03 Thread Carlos Rovira
Hi Alex,

taking into account the code from JewelExample I just posted. This code:

private function clickHandler(event:MouseEvent):void
{
var renderer:INavigationRenderer = event.currentTarget as
INavigationRenderer;
trace(renderer);
}

shows a trace = null, whatever place you click on the renderer (in the
subcomponents or directly in the renderer). event.target is right but only
in the renderer as expected.

So it seems currentTarget is not working right at least in List component.

Thanks


2018-07-03 4:10 GMT+02:00 Alex Harui :

> If event.currentTarget is not working, we need to make it work.  That is
> the recommended way to handle bubbling of events.  The browsers and Flash
> work that way so folks will expect it to work.
>
> The List's change event is not a bubbling event.  Only interaction events
> like Mouse and Keyboard events should bubble.  There were lots of folks
> overusing bubbling in old Flex code, but in Royale we should discourage
> it.  Instead each layer of the DOM should dispatch an appropriate
> higher-level semantic event.  IOW, while you can "click" anywhere in an
> item renderer, logic in the item renderer gets to determine whether to
> dispatch a higher-level semantic event like "itemClick" and "itemClick"
> events should not bubble.  Some higher-level layer might listen for
> "itemClick" and turn it into "rowClicked" for a DataGrid, and even
> higher-level might turn that into "change" or "selectionChange".
>
> So, IMO, instead of trying some new mechanism, it would be better to
> understand why currentTarget is not working for Mouse/Keyboard events, or
> add the code to propagate semantic events up the parent chain.
>
> My 2 cents,
> -Alex
>
> On 7/2/18, 2:44 PM, "carlos.rov...@gmail.com on behalf of Carlos Rovira"
>  wrote:
>
> Hi Yishay,
>
> thanks for let me know about it. I'm playing with it but I didn't get
> to
> work.
> The case is that maybe List component is not ready for this yet.
>
> * event.currentTarget seems not exists in ItemRenderers
> * I can use "itemClicked" event in a MXML List (I think is not set the
> metadata and the rest of wiring)
> * List change event doesn't work as well.
>
>  Hope you or other could point me to a more elegant solution since
> right
> now, since for me the actual solution is a hack that must be converted
> to
> something more final.
>
> Thanks
>
>
>
> 2018-07-02 16:38 GMT+02:00 Yishay Weiss :
>
> > Take a look at ItemRendererMouseController.handleMouseUp() in
> Basic. It
> > uses currentTarget.
> >
>     >
>     >
>     >
> >
>     >
> >
> > 
> > From: carlos.rov...@gmail.com  on behalf of
> > Carlos Rovira 
> > Sent: Monday, July 2, 2018 5:27:08 PM
> > To: dev@royale.apache.org
> > Subject: List Item renderer Click event finds a component in its way
> >
> > Hi,
> >
> > what's the best way to handle a click event in a List when the Item
> > renderer has some components that can interfere in the click event?
> >
> > I have an icon and a Label in the item renderer and if I click on
> one of
> > those "event.target" is logically set to this components.
> >
> > How to make "event.target" always resolve to the item-renderer, even
> if I
> > click in the label or the icon.
> > If the label or the icon has a click event, then clicking on one of
> those
> > components should call it's own click handler, but if nothing is set
> up, a
> > click in any part of the renderer should call the list click event
> handler.
> >
> > In JS I can set pointer-events : none for sub components in item
> renderers
> > but does not seems the best way to handle this
> >
> > thanks
> >
> > --
> > Carlos Rovira
> > https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%
> 7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%2BHBytWFauyvIL%
> 2BloI7dxNOF6lew%3D=0
> >
>
>
>
> --
> Carlos Rovira
> https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%
> 7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%2BHBytWFauyvIL%
> 2BloI7dxNOF6lew%3D=0
>
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: List Item renderer Click event finds a component in its way

2018-07-03 Thread Carlos Rovira
Hi Yishay,

the following code is from JewelExample, you can run it to get the final
effect for convenience.

Problem: The new Drawer component has a Navigation component. Navigation is
a List that implements navigation behavior


...







and the click handler:





Navigation has NavigationLinkItemRenderer that use to handle "text" and
"href" (this props will change the name soon to something more generic)
since is an INavigationRenderer.

In JewlExample, I'm using an NavigationIconLinkItemRenderer that is an MXML
extension that adds an Icon and Span components.

When the user clicks on the Icon/Span components and the clickHandler gets
called, event.target is one of those components and not the ItemRenderer so
"renderer" is not the INavigationRenderer. If I click in some free space in
the renderer, all is ok, renderer is INavigationRenderer and renderer gets
the right value, entering the "if" and calling main.showContent(link), that
by the way is a container that has some "screens" or organized content and
hides all content while make visible only the selected content.

So how can should deal with this kind of issue?

Expected behavior: Users can add components to an item renderer (more
icons, more text...) and all this components should not interfere by
default with the click event. Only the components that has a click event
defined should take precedence over the item renderer click event.

Maybe I'm wrong and is not a click handler, but an itemClicked? but as I
stated "itemClicked" is not part of the events managed by List. If we want
to configure this event in a List in mxml we need to add this to List.

Thanks for your help

Carlos




2018-07-03 6:37 GMT+02:00 Yishay Weiss :

> Hi  Carlos,
>
>
>
> Can you post some example app so I can understand the problem? We’re using
> List in several places in our app, including label and icon renderers, and
> haven’t had this problem.
>
>
>
> 
> From: carlos.rov...@gmail.com  on behalf of
> Carlos Rovira 
> Sent: Tuesday, July 3, 2018 12:44:17 AM
> To: dev@royale.apache.org
> Subject: Re: List Item renderer Click event finds a component in its way
>
> Hi Yishay,
>
> thanks for let me know about it. I'm playing with it but I didn't get to
> work.
> The case is that maybe List component is not ready for this yet.
>
> * event.currentTarget seems not exists in ItemRenderers
> * I can use "itemClicked" event in a MXML List (I think is not set the
> metadata and the rest of wiring)
> * List change event doesn't work as well.
>
>  Hope you or other could point me to a more elegant solution since right
> now, since for me the actual solution is a hack that must be converted to
> something more final.
>
> Thanks
>
>
>
> 2018-07-02 16:38 GMT+02:00 Yishay Weiss :
>
> > Take a look at ItemRendererMouseController.handleMouseUp() in Basic. It
> > uses currentTarget.
> >
> >
> >
> >
> >
> >
> >
> > 
> > From: carlos.rov...@gmail.com  on behalf of
> > Carlos Rovira 
> > Sent: Monday, July 2, 2018 5:27:08 PM
> > To: dev@royale.apache.org
> > Subject: List Item renderer Click event finds a component in its way
> >
> > Hi,
> >
> > what's the best way to handle a click event in a List when the Item
> > renderer has some components that can interfere in the click event?
> >
> > I have an icon and a Label in the item renderer and if I click on one of
> > those "event.target" is logically set to this components.
> >
> > How to make "event.target" always resolve to the item-renderer, even if I
> > click in the label or the icon.
> > If the label or the icon has a click event, then clicking on one of those
> > components should call it's own click handler, but if nothing is set up,
> a
> > click in any part of the renderer should call the list click event
> handler.
> >
> > In JS I can set pointer-events : none for sub components in item
> renderers
> > but does not seems the best way to handle this
> >
> > thanks
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>



-- 
Carlos Rovira
http://about.me/carlosrovira


RE: List Item renderer Click event finds a component in its way

2018-07-02 Thread Yishay Weiss
Hi  Carlos,



Can you post some example app so I can understand the problem? We’re using List 
in several places in our app, including label and icon renderers, and haven’t 
had this problem.




From: carlos.rov...@gmail.com  on behalf of Carlos 
Rovira 
Sent: Tuesday, July 3, 2018 12:44:17 AM
To: dev@royale.apache.org
Subject: Re: List Item renderer Click event finds a component in its way

Hi Yishay,

thanks for let me know about it. I'm playing with it but I didn't get to
work.
The case is that maybe List component is not ready for this yet.

* event.currentTarget seems not exists in ItemRenderers
* I can use "itemClicked" event in a MXML List (I think is not set the
metadata and the rest of wiring)
* List change event doesn't work as well.

 Hope you or other could point me to a more elegant solution since right
now, since for me the actual solution is a hack that must be converted to
something more final.

Thanks



2018-07-02 16:38 GMT+02:00 Yishay Weiss :

> Take a look at ItemRendererMouseController.handleMouseUp() in Basic. It
> uses currentTarget.
>
>
>
>
>
>
>
> 
> From: carlos.rov...@gmail.com  on behalf of
> Carlos Rovira 
> Sent: Monday, July 2, 2018 5:27:08 PM
> To: dev@royale.apache.org
> Subject: List Item renderer Click event finds a component in its way
>
> Hi,
>
> what's the best way to handle a click event in a List when the Item
> renderer has some components that can interfere in the click event?
>
> I have an icon and a Label in the item renderer and if I click on one of
> those "event.target" is logically set to this components.
>
> How to make "event.target" always resolve to the item-renderer, even if I
> click in the label or the icon.
> If the label or the icon has a click event, then clicking on one of those
> components should call it's own click handler, but if nothing is set up, a
> click in any part of the renderer should call the list click event handler.
>
> In JS I can set pointer-events : none for sub components in item renderers
> but does not seems the best way to handle this
>
> thanks
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>



--
Carlos Rovira
http://about.me/carlosrovira


Re: List Item renderer Click event finds a component in its way

2018-07-02 Thread Alex Harui
If event.currentTarget is not working, we need to make it work.  That is the 
recommended way to handle bubbling of events.  The browsers and Flash work that 
way so folks will expect it to work.

The List's change event is not a bubbling event.  Only interaction events like 
Mouse and Keyboard events should bubble.  There were lots of folks overusing 
bubbling in old Flex code, but in Royale we should discourage it.  Instead each 
layer of the DOM should dispatch an appropriate higher-level semantic event.  
IOW, while you can "click" anywhere in an item renderer, logic in the item 
renderer gets to determine whether to dispatch a higher-level semantic event 
like "itemClick" and "itemClick" events should not bubble.  Some higher-level 
layer might listen for "itemClick" and turn it into "rowClicked" for a 
DataGrid, and even higher-level might turn that into "change" or 
"selectionChange".

So, IMO, instead of trying some new mechanism, it would be better to understand 
why currentTarget is not working for Mouse/Keyboard events, or add the code to 
propagate semantic events up the parent chain.

My 2 cents,
-Alex

On 7/2/18, 2:44 PM, "carlos.rov...@gmail.com on behalf of Carlos Rovira" 
 wrote:

Hi Yishay,

thanks for let me know about it. I'm playing with it but I didn't get to
work.
The case is that maybe List component is not ready for this yet.

* event.currentTarget seems not exists in ItemRenderers
* I can use "itemClicked" event in a MXML List (I think is not set the
metadata and the rest of wiring)
* List change event doesn't work as well.

 Hope you or other could point me to a more elegant solution since right
now, since for me the actual solution is a hack that must be converted to
something more final.

Thanks



2018-07-02 16:38 GMT+02:00 Yishay Weiss :

> Take a look at ItemRendererMouseController.handleMouseUp() in Basic. It
> uses currentTarget.
>
>
>
>
>
>
>
> 
> From: carlos.rov...@gmail.com  on behalf of
> Carlos Rovira 
    > Sent: Monday, July 2, 2018 5:27:08 PM
> To: dev@royale.apache.org
> Subject: List Item renderer Click event finds a component in its way
>
> Hi,
>
> what's the best way to handle a click event in a List when the Item
> renderer has some components that can interfere in the click event?
>
> I have an icon and a Label in the item renderer and if I click on one of
> those "event.target" is logically set to this components.
>
> How to make "event.target" always resolve to the item-renderer, even if I
> click in the label or the icon.
> If the label or the icon has a click event, then clicking on one of those
> components should call it's own click handler, but if nothing is set up, a
> click in any part of the renderer should call the list click event 
handler.
>
> In JS I can set pointer-events : none for sub components in item renderers
> but does not seems the best way to handle this
>
> thanks
>
> --
> Carlos Rovira
> 
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%2BHBytWFauyvIL%2BloI7dxNOF6lew%3D=0
>



-- 
Carlos Rovira

https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira=02%7C01%7Caharui%40adobe.com%7C6a108592eeb643ebcf2b08d5e0650676%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636661646889224052=YbiK4qjpjqCpxmvP%2BHBytWFauyvIL%2BloI7dxNOF6lew%3D=0




Re: List Item renderer Click event finds a component in its way

2018-07-02 Thread Piotr Zarzycki
Carlos,

I was just curious how it behave in that case. :) Definitely I'm not
suggesting that as a solution.

Thanks,
Piotr

On Mon, Jul 2, 2018, 11:44 PM Carlos Rovira  wrote:

> Hi Yishay,
>
> thanks for let me know about it. I'm playing with it but I didn't get to
> work.
> The case is that maybe List component is not ready for this yet.
>
> * event.currentTarget seems not exists in ItemRenderers
> * I can use "itemClicked" event in a MXML List (I think is not set the
> metadata and the rest of wiring)
> * List change event doesn't work as well.
>
>  Hope you or other could point me to a more elegant solution since right
> now, since for me the actual solution is a hack that must be converted to
> something more final.
>
> Thanks
>
>
>
> 2018-07-02 16:38 GMT+02:00 Yishay Weiss :
>
> > Take a look at ItemRendererMouseController.handleMouseUp() in Basic. It
> > uses currentTarget.
> >
> >
> >
> >
> >
> >
> >
> > 
> > From: carlos.rov...@gmail.com  on behalf of
> > Carlos Rovira 
> > Sent: Monday, July 2, 2018 5:27:08 PM
> > To: dev@royale.apache.org
> > Subject: List Item renderer Click event finds a component in its way
> >
> > Hi,
> >
> > what's the best way to handle a click event in a List when the Item
> > renderer has some components that can interfere in the click event?
> >
> > I have an icon and a Label in the item renderer and if I click on one of
> > those "event.target" is logically set to this components.
> >
> > How to make "event.target" always resolve to the item-renderer, even if I
> > click in the label or the icon.
> > If the label or the icon has a click event, then clicking on one of those
> > components should call it's own click handler, but if nothing is set up,
> a
> > click in any part of the renderer should call the list click event
> handler.
> >
> > In JS I can set pointer-events : none for sub components in item
> renderers
> > but does not seems the best way to handle this
> >
> > thanks
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


Re: List Item renderer Click event finds a component in its way

2018-07-02 Thread Carlos Rovira
Hi Yishay,

thanks for let me know about it. I'm playing with it but I didn't get to
work.
The case is that maybe List component is not ready for this yet.

* event.currentTarget seems not exists in ItemRenderers
* I can use "itemClicked" event in a MXML List (I think is not set the
metadata and the rest of wiring)
* List change event doesn't work as well.

 Hope you or other could point me to a more elegant solution since right
now, since for me the actual solution is a hack that must be converted to
something more final.

Thanks



2018-07-02 16:38 GMT+02:00 Yishay Weiss :

> Take a look at ItemRendererMouseController.handleMouseUp() in Basic. It
> uses currentTarget.
>
>
>
>
>
>
>
> 
> From: carlos.rov...@gmail.com  on behalf of
> Carlos Rovira 
> Sent: Monday, July 2, 2018 5:27:08 PM
> To: dev@royale.apache.org
> Subject: List Item renderer Click event finds a component in its way
>
> Hi,
>
> what's the best way to handle a click event in a List when the Item
> renderer has some components that can interfere in the click event?
>
> I have an icon and a Label in the item renderer and if I click on one of
> those "event.target" is logically set to this components.
>
> How to make "event.target" always resolve to the item-renderer, even if I
> click in the label or the icon.
> If the label or the icon has a click event, then clicking on one of those
> components should call it's own click handler, but if nothing is set up, a
> click in any part of the renderer should call the list click event handler.
>
> In JS I can set pointer-events : none for sub components in item renderers
> but does not seems the best way to handle this
>
> thanks
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>



-- 
Carlos Rovira
http://about.me/carlosrovira


Re: List Item renderer Click event finds a component in its way

2018-07-02 Thread Carlos Rovira
Hi Piotr,

I just tried to disable both components but components are still
intercepting the click and calling the function so the error is generated.
But I think although this could work, not seems to me like a final
solution, since I don't think users should need to disable components in an
item renderer to make IR default functionality to work.
Anyway thanks for the suggestion :)

2018-07-02 16:35 GMT+02:00 Piotr Zarzycki :

> Hi Carlos,
>
> What has happened if children (in that case your icon and Label), are
> disabled ?
>
> Thanks,
> Piotr
>
> pon., 2 lip 2018 o 16:27 Carlos Rovira 
> napisał(a):
>
> > Hi,
> >
> > what's the best way to handle a click event in a List when the Item
> > renderer has some components that can interfere in the click event?
> >
> > I have an icon and a Label in the item renderer and if I click on one of
> > those "event.target" is logically set to this components.
> >
> > How to make "event.target" always resolve to the item-renderer, even if I
> > click in the label or the icon.
> > If the label or the icon has a click event, then clicking on one of those
> > components should call it's own click handler, but if nothing is set up,
> a
> > click in any part of the renderer should call the list click event
> handler.
> >
> > In JS I can set pointer-events : none for sub components in item
> renderers
> > but does not seems the best way to handle this
> >
> > thanks
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> *
>



-- 
Carlos Rovira
http://about.me/carlosrovira


RE: List Item renderer Click event finds a component in its way

2018-07-02 Thread Yishay Weiss
Take a look at ItemRendererMouseController.handleMouseUp() in Basic. It uses 
currentTarget.








From: carlos.rov...@gmail.com  on behalf of Carlos 
Rovira 
Sent: Monday, July 2, 2018 5:27:08 PM
To: dev@royale.apache.org
Subject: List Item renderer Click event finds a component in its way

Hi,

what's the best way to handle a click event in a List when the Item
renderer has some components that can interfere in the click event?

I have an icon and a Label in the item renderer and if I click on one of
those "event.target" is logically set to this components.

How to make "event.target" always resolve to the item-renderer, even if I
click in the label or the icon.
If the label or the icon has a click event, then clicking on one of those
components should call it's own click handler, but if nothing is set up, a
click in any part of the renderer should call the list click event handler.

In JS I can set pointer-events : none for sub components in item renderers
but does not seems the best way to handle this

thanks

--
Carlos Rovira
http://about.me/carlosrovira


Re: List Item renderer Click event finds a component in its way

2018-07-02 Thread Piotr Zarzycki
Hi Carlos,

What has happened if children (in that case your icon and Label), are
disabled ?

Thanks,
Piotr

pon., 2 lip 2018 o 16:27 Carlos Rovira  napisał(a):

> Hi,
>
> what's the best way to handle a click event in a List when the Item
> renderer has some components that can interfere in the click event?
>
> I have an icon and a Label in the item renderer and if I click on one of
> those "event.target" is logically set to this components.
>
> How to make "event.target" always resolve to the item-renderer, even if I
> click in the label or the icon.
> If the label or the icon has a click event, then clicking on one of those
> components should call it's own click handler, but if nothing is set up, a
> click in any part of the renderer should call the list click event handler.
>
> In JS I can set pointer-events : none for sub components in item renderers
> but does not seems the best way to handle this
>
> thanks
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
*


List Item renderer Click event finds a component in its way

2018-07-02 Thread Carlos Rovira
Hi,

what's the best way to handle a click event in a List when the Item
renderer has some components that can interfere in the click event?

I have an icon and a Label in the item renderer and if I click on one of
those "event.target" is logically set to this components.

How to make "event.target" always resolve to the item-renderer, even if I
click in the label or the icon.
If the label or the icon has a click event, then clicking on one of those
components should call it's own click handler, but if nothing is set up, a
click in any part of the renderer should call the list click event handler.

In JS I can set pointer-events : none for sub components in item renderers
but does not seems the best way to handle this

thanks

-- 
Carlos Rovira
http://about.me/carlosrovira