How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

Ramazan Ergüder Bekrek
I have a specific use case where I have a ParagraphItemRenderer.

In that ItemRenderer there is a List with SubParagraphItemRenderer (Paragraph.children)

In that SubParagraphItemRenderer there is List with SubParagraphItemRenderer (SubParagraph.children)

How am I able to achieve this desired mouse handling:

When I click a ParagraphItemRenderer it gets selected (normal behavior)

If I select a child SubParagraphItemRenderer I would like the parent to not be selected anymore but right now both gets selected.

I would like the parent to be deselected and the children selected.

Is there any possibility for this case?

Best Regards

Ergü
Reply | Threaded
Open this post in threaded view
|

Re: How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

Ramazan Ergüder Bekrek
This is a visual which could help to understand : https://pasteboard.co/IGNIK02.png

I would like it to be either the parent SubParagraph or the child SubParagraph to be selected not both.

15.11.2019, 13:39, "Ramazan Ergüder Bekrek" <[hidden email]>:

> I have a specific use case where I have a ParagraphItemRenderer.
>
> In that ItemRenderer there is a List with SubParagraphItemRenderer (Paragraph.children)
>
> In that SubParagraphItemRenderer there is List with SubParagraphItemRenderer (SubParagraph.children)
>
> How am I able to achieve this desired mouse handling:
>
> When I click a ParagraphItemRenderer it gets selected (normal behavior)
>
> If I select a child SubParagraphItemRenderer I would like the parent to not be selected anymore but right now both gets selected.
>
> I would like the parent to be deselected and the children selected.
>
> Is there any possibility for this case?
>
> Best Regards
>
> Ergü
Reply | Threaded
Open this post in threaded view
|

Re: How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

Olaf Krueger
Hi,

did you try to handle the click event of the SubParagraph in order to set
the selectedItem(s)/selectedIndex of the parent list to null?

Maybe this helps,
Olaf



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

kamcknig
In reply to this post by Ramazan Ergüder Bekrek
Implementation might depend on things like if the parents can ever/never be
selected.

But you can do things like handle the changing event on the parent items and
prevent default on the event in certain instances or all the time.

Here is a pastebin https://pastebin.com/jpRc0U1s



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

Ramazan Ergüder Bekrek
In reply to this post by Olaf Krueger
Well for the SubParagraphItemRenderer I included focusOut event as following:
This part is working but still the Paragraph always gets selected automatically.

protected function onFocusOut(event:FocusEvent):void
                        {
                                subparagraphs.selectedItem = null;
                        }

15.11.2019, 14:08, "Olaf Krueger" <[hidden email]>:

> Hi,
>
> did you try to handle the click event of the SubParagraph in order to set
> the selectedItem(s)/selectedIndex of the parent list to null?
>
> Maybe this helps,
> Olaf
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

Olaf Krueger
Maybe it helps to simplify your use case at first:
Create a simple list and try to deselect an item programatically.
If that works, I would continue with an itemRenderer and then with a nested
itemRender...

You may need to force a redraw of the list by calling an invalidate method,
not sure.
I have not used Flex for a longer time so it's just a shoot in a dark..





--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to implement complex mouse focus in ItemRenderer with a list which has a children ItemRenderers which has a list with children ItemRenderers and so on,,,,?

Ramazan Ergüder Bekrek
I found a much easier way than this complicated idea...
I am now using rollOver and rollOut to display only the command bar for each respective itemrenderer.

That way I don't need to deal with complexity.

15.11.2019, 15:11, "Olaf Krueger" <[hidden email]>:

> Maybe it helps to simplify your use case at first:
> Create a simple list and try to deselect an item programatically.
> If that works, I would continue with an itemRenderer and then with a nested
> itemRender...
>
> You may need to force a redraw of the list by calling an invalidate method,
> not sure.
> I have not used Flex for a longer time so it's just a shoot in a dark..
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/