Closed DracoBlue closed 10 years ago
What would be a practical example use case for this?
Wouldn't it be simpler and easier to maintain, if there was just one JSB that would wrap both of the required behaviors? Especially since this example sounds like the order of execution is important (validation before reference browser).
on the element one both behaviours are appended on the other element i had only one behaviour of them. I can create a wrapper behaviour but it will be hard for situation like this one where you render dynamic the behaviours to the element:
<div class="jsb_ jsb_BehaviourOne jsb_BehaviourTwo">...</div>
<div class="jsb_ jsb_BehaviourOne jsb_BehaviourThree">...</div>
<div class="jsb_ jsb_BehaviourTwo jsb_BehaviourThree">...</div>
<div class="jsb_ jsb_BehaviourTwo">...</div>
We have some options to add data values for those.
Here are 2, which @eberdt and I made up while discussing:
First: Use data-jsb-behaviour-name="key=value" and data-jsb as "fallback"
<div class="jsb_ jsb_idValidator jsb_browser/referenceBrowser" data-jsb-browser-referenceBrowser="key=value"></div>
Second: Use a specific MultipleBehaviours behaviour
class=jsb_ jsb_MultipleBehaviours
data-jsb={"referenceBrowser": {"key":"value"}, "blink": {"key2":"key3"}}
What do you think?
I'd rather not have different support for key/value or json data depending on one or multiple behaviours being present. It should be consistent everywhere (usage/feature wise).
How about one data attribute per behaviour with fallback to data-jsb
when no specific data-jsb-*
attribute exists:
<div class="jsb_ jsb_Foo jsb_Core/Bar" data-jsb-foo="..." data-jsb-core-bar="..." />
<div class="jsb_ jsb_One jsb_Core/Two" data-jsb-one="..." data-jsb="..." />
That way developers have the ability to just put everything into data-jsb
and if behaviours start to have different options they can get that without a BC break.
I agree with @graste.
I agree with @graste, too
Currently only one element is possible, but it should be possible to add multiples.
@eberdt use case is: