You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2022/04/12 17:12:22 UTC
[GitHub] [royale-asjs] cristallium opened a new issue, #1192: Jewel List : How to detect selectedChange event in an itemRenderer ?
cristallium opened a new issue, #1192:
URL: https://github.com/apache/royale-asjs/issues/1192
Hi, sorry if it's a noob question, but I'm stuck on an easy case :
I have a List like this :
```
.CarListItemRenderer
{
IItemRenderer: ClassReference("itemRenderers.CarListItemRenderer");
}
<j:List width="100%" height="100%" id="lst_cars" className="CarListItemRenderer" >
```
The itemRenderer :
```
<j:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:js="library://ns.apache.org/royale/basic"
xmlns="http://www.w3.org/1999/xhtml" height="50" >
<fx:Script>
<![CDATA[
import org.apache.royale.collections.ArrayList;
import org.apache.royale.jewel.List;
import org.apache.royale.jewel.beads.views.ListView;
import model.Car;
[Bindable("selectionChanged")]
private function ev_selectionChanged(e:Event):void{
trace ("selection changed");
}
[Bindable("dataChange")]
public function get name():String
{
return (data as Car).name;
}
]]>
</fx:Script>
<j:beads>
<js:ItemRendererDataBinding />
</j:beads>
<j:Label html="{name}" multiline="true"/>
</j:ListItemRenderer>
```
But `ev_selectionChanged()` is never called.
How to do to call this function in the renderer when selection changed ?
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [royale-asjs] cristallium commented on issue #1192: Jewel List : How to detect selectedChange event in an itemRenderer ?
Posted by GitBox <gi...@apache.org>.
cristallium commented on issue #1192:
URL: https://github.com/apache/royale-asjs/issues/1192#issuecomment-1097144690
Many thanks !!! this is working like you said (calling addEventListener on set data)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [royale-asjs] cristallium closed issue #1192: Jewel List : How to detect selectedChange event in an itemRenderer ?
Posted by GitBox <gi...@apache.org>.
cristallium closed issue #1192: Jewel List : How to detect selectedChange event in an itemRenderer ?
URL: https://github.com/apache/royale-asjs/issues/1192
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [royale-asjs] yishayw commented on issue #1192: Jewel List : How to detect selectedChange event in an itemRenderer ?
Posted by GitBox <gi...@apache.org>.
yishayw commented on issue #1192:
URL: https://github.com/apache/royale-asjs/issues/1192#issuecomment-1097085104
Have you tried 'change' instead of 'selectionChanged'?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [royale-asjs] cristallium commented on issue #1192: Jewel List : How to detect selectedChange event in an itemRenderer ?
Posted by GitBox <gi...@apache.org>.
cristallium commented on issue #1192:
URL: https://github.com/apache/royale-asjs/issues/1192#issuecomment-1097102931
Thank, for help.
`[Bindable("change")]` doesn't work
If you thought about `host.addEventListener("selectionChanged",ev_selectionChanged);` the issue is that this is never reach because this.itemRendererOwnerView is null on initComplete
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [royale-asjs] yishayw commented on issue #1192: Jewel List : How to detect selectedChange event in an itemRenderer ?
Posted by GitBox <gi...@apache.org>.
yishayw commented on issue #1192:
URL: https://github.com/apache/royale-asjs/issues/1192#issuecomment-1097125421
Looking at DataItemRendererFactoryBase.as it looks like item renderers are first added (triggering initComplete), and then initialized with owner among other things. I would try to add the event listener on set data, which happens after initialization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org