You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that when a Template is set, the config event that's fired is for the Template.KEY ConfigKey. So any class using the auto-update idiom will not update their values for config keys within the template. If the template hasn't already been set before the object (that's using the idiom) is constructed, then the object won't be configured with the template values. This leaves them unset even when there's a value set in the template.
It's not sufficient to just use a convention where the template is set before any other configuration to make sure the template is available. This is because some of the objects created in the template may themselves be dependent on other things in the template (e.g. Initialiser component and Initialiser.METHOD).
One (imperfect) solution is to always add Template.KEY to the fields that trigger a reconfiguration in the auto-update idiom, like this:
public void onEvent(ConfigEvent event) {
if (event.isKindOf(Template.KEY, RandomSequence.RANDOM_SEQUENCE)) {
setup();
}
}
The text was updated successfully, but these errors were encountered:
The problem is that when a Template is set, the config event that's fired is for the Template.KEY ConfigKey. So any class using the auto-update idiom will not update their values for config keys within the template. If the template hasn't already been set before the object (that's using the idiom) is constructed, then the object won't be configured with the template values. This leaves them unset even when there's a value set in the template.
It's not sufficient to just use a convention where the template is set before any other configuration to make sure the template is available. This is because some of the objects created in the template may themselves be dependent on other things in the template (e.g. Initialiser component and Initialiser.METHOD).
One (imperfect) solution is to always add Template.KEY to the fields that trigger a reconfiguration in the auto-update idiom, like this:
public void onEvent(ConfigEvent event) {
if (event.isKindOf(Template.KEY, RandomSequence.RANDOM_SEQUENCE)) {
setup();
}
}
The text was updated successfully, but these errors were encountered: