« Return to Thread: tap5-103

tap5-103

by Robert Zeigler :: Rate this Message:

Reply to Author | View in Thread

I'm looking at tackling tap5-103 (provide access to component  
parameters from within mixins).

One way to do this would be to have some service injectable into  
mixins from which you could fetch parameters by name,
similar to how component parameter could be manipulated by name in T3/
T4.  This might be the simplest way to implement this, but also the  
least elegant for the end-user.

The other thought is to have a sort of chained binding approach,  
something like:

@BindParameter("object")//value is optional and defaults to the  
variable name
private Object object;


In a use-case like:

<t:beaneditor t:id="myeditor" object="myobject" t:mixins="mymixin"/>

mypage.myobject <=> mymixin.object <=> beaneditor.object

So changes to "object" in beaneditor will be back-propagated to  
mymixin.object and from there to mypage.myobject, and vice-versa.
In the case of multiple mixins:

<t:beaneditor t:id="myeditor" object="myobject"  
t:mixins="mymixin1,mymixin2,mymixin3"/>

It would just be:

mypage.myobject <=> mymixin1.object <=> mymixin2.object <=>  
mymixin3.object <=> beaneditor.object.

Any mixins in the chain that don't bind the parameter of interest  
would be bypassed.


I was also thinking about the @MixinAfter and whether that would  
affect the ordering within the binding chain... I don't think so.

Thoughts?

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

 « Return to Thread: tap5-103