Hugo, how would you like to pass to the itemRenderer the function or the Array 
of fields, through a bead?
I can expose the implementation that I use when I need to pass to an 
itemRenderer specific properties (in your case it would be an Array of fields 
to compose the text)

I mainly use two new components:
1- Creation of a component "ListItemRendererProperties" that extends 
"ListItemRenderer" and to which I have added a new property "properties" 
(Object, key-value pairs).
2- Creation of a new bead "ListItemRendererPropertiesBead" that oversees 
transferring the object "properties" to each itemRenderer.

If you like the idea I can extend it and we can implement your needs.

Let me know if you like the idea.

Hiedra

-----Mensaje original-----
De: Hugo Ferreira <hferreira...@gmail.com> 
Enviado el: miércoles, 8 de junio de 2022 0:38
Para: Apache Royale Development <dev@royale.apache.org>
Asunto: Re: Proposal for labelField with expression support

@Harbs, that would be nice for this particular use case. Until then, I will use 
this monkey patch. May not be the best solution but works for me.

@Eduard, it's for mxml.

@Alex, I thought that. I have many, many beads on my side that personalize the 
behaviours just as I want with things very specific that should not be put on 
the SDK. Beads are a perfect and elegant solution to modify the SDK behaviour 
but I don't know how to use them on this scenario.

For now I will use this monkey patch until we have a better solution to replace.

Alex Harui <aha...@adobe.com.invalid> escreveu no dia terça, 7/06/2022 à(s)
23:21:

> You could probably come up with an app-level bead that overwrites a 
> utility function.
>
> But it might be more interesting to explore providing an example of 
> using
> ES5 Template Literals
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Temp
> late_literals
> in an item renderer.
>
> getLabelFromData is called by a dataToString, so dataToString could be 
> overridden to return such a string literal.  IMO, that would perform 
> better since the browser JS engine would do the string substitution.  
> Yes, it means custom item renderers, instead of interpreting 
> labelField, but it would show that Royale can use new cool ES5 
> optimizations.  Might require a compiler change, not sure.
>
> And it wouldn't have backward compatibility implications or 
> monkey-patch the SDK.
>
> Just a thought,
> -Alex
>
> On 6/7/22, 2:56 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>
>     EXTERNAL: Use caution when clicking on links or opening attachments.
>
>
>     I’d love to come up a pattern for hot-swapping utility functions, 
> but we don’t have one yet...
>
>     > On Jun 8, 2022, at 12:38 AM, Hugo Ferreira 
> <hferreira...@gmail.com>
> wrote:
>     >
>     > Yes, I know that.
>     > But seems a bazooka for a simple thing.
>
>
>

Reply via email to