Two attributes with calculated value scripts with a dependency between them.
I have two attributes with calculated value scripts. The second attribute has a dependency with first attribute. But when the first script is triggered and it calculates value for first attribute then the second script is not trigger. How can I set the dependency between them for triggering events in cascade?
Accepted answer
hi Fran,
atr_first <> depends on <> some_other_attribute
<> applied with <> first script
atr_scnd <> depends on <> atr_first
<> applied with <> second script
if this is case, I do not see anything more that is required for the second script to take effect and update the atr_scnd.
quick things i would review are
a. ensure that the second script is indeed applied to atr_scnd
b. second script reads the "right attribute id" from within, so as to understand the value change and return a different result
c. perform a firebug trace, with a breakpoint inside the second script
or a console.warn message from withing second script to know if its getting triggered or not
hope this helps
Regards,
Dinesh
atr_first <> depends on <> some_other_attribute
<> applied with <> first script
atr_scnd <> depends on <> atr_first
<> applied with <> second script
if this is case, I do not see anything more that is required for the second script to take effect and update the atr_scnd.
quick things i would review are
a. ensure that the second script is indeed applied to atr_scnd
b. second script reads the "right attribute id" from within, so as to understand the value change and return a different result
c. perform a firebug trace, with a breakpoint inside the second script
or a console.warn message from withing second script to know if its getting triggered or not
hope this helps
Regards,
Dinesh
One other answer
There are no problems with cascading "change events" in JavaScript. Note the word "change" - if the first script sets a value same as the original to the first attribute, the second script will not be triggered, as there is no change. You should also verify that the second script can be executed by manually changing the value of the first attribute.