In case anyone is interested ...

The problem occurs because the "src" is assigned through a bindated variable 
"rejectedSrc", change the binding by manual setting and to work.

I don't know why the "src" property receives an empty string in the binding (I 
have verified that the get "always returns the path of the image" correctly) 
when the bead is added to the component, but surely I am missing something.



In case anyone is interested in seeing the result ... [1]



[1] https://github.com/mjesteve/royale-examples/tree/main/Custom/TriCheckBox



The resizing of the image representing the "rejected" status is not 
implemented, if someone feels like 😝 ...



Hiedra



-----Mensaje original-----

De: Maria Jose Esteve <[email protected]>

Enviado el: martes, 5 de enero de 2021 12:01

Para: [email protected]

Asunto: Comportamiento anómalo al añadir bead personalizado



Hi,

We are creating a small component (mxml), TriCheckBox, with 3 states 
(unchecked, rejected & checked). It is made up of a Jewel CheckBox and a Jewel 
Image (src “assets / tristate_checkbox.png”). The checkbox is visible in the 
“unchecked and checked” states and the image is visible in the “rejected” state.

Now I have created a bead, TriCheckBoxLabelByValue, which sets the "text" 
property of the checkbox according to the state (rejectedText, uncheckedText & 
checkedText). The thing is, the bead works, it changes the "text" as expected, 
BUT the Image component LOSES the src and shows nothing.

Any clues as to why this may be happening to me?

Here I show you how it works, gif [1], and the current implementation of the 
control [2] and the bead [3] and the capture of the Chrome debugger where you 
can see that the check “without the bead” [4] contains property "src" but "with 
the bead" not [5].



[1] 
https://github.com/mjesteve/royale-examples/blob/main/Temp/TriCheckBox/TriCheckBox_1.gif

[2] 
https://github.com/mjesteve/royale-examples/blob/main/Temp/TriCheckBox/TriCheckBox.mxml

[3] 
https://github.com/mjesteve/royale-examples/blob/main/Temp/TriCheckBox/TriCheckBoxLabelByValue.as

[4] 
https://github.com/mjesteve/royale-examples/blob/main/Temp/TriCheckBox/debug_nobead.png

[5] 
https://github.com/mjesteve/royale-examples/blob/main/Temp/TriCheckBox/debug_bead.png



As always, any comments will be well received. 😊



Thx.

Hiedra














Reply via email to