I have the following scenario:
i have layer X and layer Y
in layer X I have features X1 X2 X3
in layer Y I have features Y1 till Y15 for example
the symbology of features Y1 to Y5 is dependent on a field in X1
example if the field "status" in X1 is off, Y1 to Y5 becomes red
if the field "status" in X1 is on, Y1 to Y5 becomes green
same thing for the remaining features, where Y6 to Y10 in dependent on X2 and Y11 to Y15 is dependent on X3
is there a way to do that in WAB?
Are the values for X1-X3 status field going to change dynamically during the use of the app? Is the user going to have the ability to edit the status field?
Using the editor widget or some custom widget? The issue is capturing the attribute change event to trigger a new renderer symbol to be applied to layer2.
That will be the problem so since it is not a user change in your code that makes the status field change you do not have a coded event that you can respond to to make the symbology change. So now you have to find a way to determine when the attribute value changes. So off the top of my head I would think you have to have a widget or some code in the MapManager.js that queries the feature on a specified interval to see if the attributes have changed and then react if they do.
You don't. You just listen for the attribute changes on Layer 1 on a setInterval and then if the status field changes then you apply a different renderer/symbol to layer2.