Approach to passing xml context to another control #314
Replies: 1 comment
-
|
Hello! As I understand it you have a tree like this: You need to pass 'some' data from D to C. There are a few solutions here. Easiest (but you can't always get away with it) is using more XPath. A ref does not need to be a child step. A Second one is events (if the 'action' on the control D is important). You can emit it on the control itself (or if the higher coupling is OK, directly on control C. You can take inspiration from these examples: catching events with fx-action and throwing events with fx-dispatch. If your structure is repeated, know that the ID resolving keeps that into account. it's smart enough an element with If it's rather 'state', I'd make a separate instance holding that application state. And write and read to that. Does this help you on your way? Martin |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have fx-controls nested say 3 deep. Working great. I like how the context is passed down the tree - keeps things as simple as possible.
However, that tight scoping creates a problem in another use case. An fx-control at level 3 needs to set the context, or at least pass a parameter somehow, to another fx-control which is elsewhere in the tree structure, at level 1.
From the users point of view they presses a button in the source fx-control at level 3, and they and their context is passed to the other fx-control in another branch of the XML tree at level 1.
I have explored a number of approaches but cant find one that works.
Can I have suggestions on approach?
Beta Was this translation helpful? Give feedback.
All reactions