Hi Mark,
I don't know how the binding in Flex worked internally but if gp is null an
error would surely occur, perhaps it was an internal error that was intercepted
but...
I can share with you how I do it, although I don't know if it is the best way:
<ns7:CustomButtonBar id="topCBB"
btnA="['Home','Statistics','Network','MCA Grid']"
btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
itemH="36"
fntSz="16"/>
Or
btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
Or
btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl,
gp.siteNetworkCtrl, gp.dgBOX]}"
It depends on what works for you.
Hiedra
De: MARK HARTNETT <[email protected]>
Enviado el: jueves, 2 de mayo de 2024 18:44
Para: [email protected]
Asunto: JS questions
Hi all,
All of my errors right now are null references.
In this code gp.hpc crashes because hpc is null at this point.
In Flex, I didn't care about that because once init() was done it was no longer
null.
<ns7:CustomButtonBar id="topCBB"
btnA="['Home','Statistics','Network','MCA Grid']"
btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
itemH="36"
fntSz="16"/>
With JS the null hpc throws an error.
Moving those variables to creationComplete solves the problem.
What is the difference with JS binding and Flex in terms of timing and object
creation?
Is there a a bead that allows nulls?
Thanks