You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Ramazan Ergüder Bekrek <e....@yandex.com> on 2019/11/15 12:39:06 UTC

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,,,,?

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ü

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,,,,?

Posted by Ramazan Ergüder Bekrek <e....@yandex.com>.
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" <ma...@olafkrueger.net>:
> 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/

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,,,,?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
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/

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,,,,?

Posted by Ramazan Ergüder Bekrek <e....@yandex.com>.
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" <ma...@olafkrueger.net>:
> 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/

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,,,,?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
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/

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,,,,?

Posted by kamcknig <ka...@gmail.com>.
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/

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,,,,?

Posted by Ramazan Ergüder Bekrek <e....@yandex.com>.
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" <e....@yandex.com>:
> 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ü