I had some sucess with @ComponentAnnotation("@bind(vmsgs['keyword'])")
, which only has the "problem", that the component that goes into the validation is the macro component, not the specific subcomponent, so the only "key" I get is not the sub-component id, but the ViewModel's property...
Did you try tot reach the binder in aftercompose? Normally then you could add the binding to the correct component.
chillworld ( 2016-09-02 18:38:16 +0800 )editIt works for one macrocomponent, but as soon as I stack them in another, bigger mc, that one becomes the "source" for the validator, which means that I cannot (easily) have multiple "values" in one mc without some naming convention - instead of simply relying on id.
FlorianSchaetz ( 2016-09-02 19:00:35 +0800 )editIs it possible tot create a fiddle that combines 2 MC with that problemen? I see if I van check it out
chillworld ( 2016-09-02 19:14:21 +0800 )editThanks, will try. @ComponentAnnotation("@bind(vmsgs[self.id])")
works quite fine. Problem now: My label+textbox+error mc could be used alone (then the BindContext.component.id would be the correct key for that) or inside another mc (then SavePropertyBinding.fieldName would be the correct key).