Hi,
I have views with many long methods.
<view>
<method name="A1"/>
<method name="A2"/>
...
<method name="B1"/>
<method name="B2"/>
...
<method name="C1"/>
<method name="C2"/>
...
</view>
So I though about splitting the source file into manageable pieces like
this:
<view>
<include href="A_methods"/>
<include href="B_methods"/>
<include href="C_methods"/>
</view>
In the included files I can not use library tag because it belongs under
canvas.
So I must come up with a root node that I don't want, eg.
<ARootThatGetsInMyWay>
<method name="A1"/>
<method name="A2"/>
...
</ARootThatGetsInMyWay>
This requirement comes from XML parser because when it includes the
"snippet" it is treated a an XML document that must have a single root.
(At least that is what I assume...)
It would not bother me if it would not break all my references.
I think that mixins for instances will alleviate this issue, because
then I could say:
<view with="A_methods, B_methods, C_methods">
...
</view>
And in the included file write
<library>
<mixin name="A_methods">
<method name="A1"/>
<method name="A2"/>
...
</mixin>
</library>
Another way to fix this issue would be to come up with an
invisible/structural element that could be used as the root element. It
would not be a node at all and be completely omitted from laszlo's node
hierarchy.
I was thinking about writing such but then thought that it might be too
difficult to write such a thing overriding construct/createChildren methods.
So all in all waiting for the mixin feature for instances...
- rami