Referencing nested components - is it possible ???
-
Is it possible to reference nested components when using DC's ???
..........................................................................
For example, 3 Components:1,2,3
1 is the outer most component [Outer]
2 is middle component [Middle]
3 is inner most component (buried the deepest) [Inner]
..........From the Inner Component, all Parent attributes are easily referenced eg by using
=Middle!Attribute1 OR
=Parent!Attribute1 etc..................
HOWEVER, from the Inner Component, is it possible to reference attributes directly in the Outer most Component ???
.................
I've tried the obvious eg:Outer!Middle!Attribute1
Parent!Parent!Attribute1
..................
As a workaround, I've referenced attributes from the Outer Component to the Middle Component and then
referenced these same attributes from the Middle Component to the Inner Component.
(A bit like copying the attributes from one component to the next as an intermediate step).Its a bit cumbersome - but it does work.
It would be much better to be able to reference such nested components directly.
.............
I hope this all makes sense !!!
Any help, much appreciated.
...............
Regards
Howard Leslie -
No, references can't skip levels. So you have to do it like you did unfortunately.
Chris
-
It may be possible with a custom Ruby function.
It could look like this:
=lookup("a")
Which would look up the hierarchy until it found "a"; at which point it would return the value of "a" or something like "undefined" if a was not found.
-
Chris / Jim,
Thanks very much for your replies.
It's as I suspected, but it's really good to get confirmation from peers as DC's aren't comprehensivley documented.
...........
A possible request for a future enhancement for DC's - ability to reference any attribute from any level ???
...........
Regards
Howard L' -
Howard, I can see if I can write this method if it would be of use. If you were to use such a method, it would need to be distributed along with the DC so other people could use it.
-
Jim,
Thank you very much for the offer to write some Ruby code for this.
However, there's no real need to put yourself to the trouble.
I can work around the problem OK for now.
............................................
As suggested earlier though, a way of having something built into the core program in the future would be good.
A possible enhancement for SU V8 ???
.............................................In the days of DOS we used ...... to go up levels in directory trees.
A similar feature for DCs in the future would be really good eg
Parent!Parent!Parent!Attribute1 - ie a way to navigate up levels in RELATIVE terms
..............................................
Regards
Howard L'
Advertisement