PDA

View Full Version : Defaultplacement to sub sub views


origati
02-08-2007, 04:53 AM
I know defaultplacement works to put subviews of a class inside a subview, but it doesn't works on several subviews. Any idea on how to do it?

Better I write an example of what doesn't work:



<class name="myclass" defaultplacement="a.b.content">
<view name="a">
<view name="b">
<view name="content"/>
</view>
</view>
</class>

<myclass>
<view width="10" height="10" bgcolor="red"/>
</myclass>



The red box will be placed at the classroot, not at a.b.content.

origati
02-08-2007, 05:38 AM
I will answer to myself

This code works now:



<class name="myclass" defaultplacement="a">
<view name="a" defaultplacement="b">
<view name="b" defaultplacement="content">
<view name="content"/>
</view>
</view>
</class>

<myclass>
<view width="10" height="10" bgcolor="red"/>
</myclass>

trucker_
02-08-2007, 06:14 AM
Nice solution ! thnx

senshi
02-10-2007, 03:19 AM
Isn't this easier...?


<class name="myclass" defaultplacement="content">
<view>
<view>
<view name="content"/>
</view>
</view>
</class>

<myclass>
<view width="10" height="10" bgcolor="red"/>
</myclass>

origati
02-10-2007, 10:49 AM
Isn't this easier...?


I need the other views to have a name, and your solution didn't work on my test, the views added to the class instantiation where placed at the classroot.

Anyway, I don't tried your solution because mine works :D

Never modify anything is working!!

senshi
02-10-2007, 11:13 AM
I need the other views to have a name, and your solution didn't work on my test, ...

I've just omitted the names to show that they're unneeded for defaultplacement.
And this does work, I've tested it myself.

origati
02-10-2007, 11:17 PM
You are right senshi. I belive I've tried this, but I didn't.

Thanks!