PDA

View Full Version : Error setting an attribute


rfreixes
10-06-2007, 05:01 PM
Hi people,

I have an error with my implementation...

My code is something like:

<class name="categoria" ondblclick="select()">
<attribute name="resource" type="string"/>
<attribute name="selectionobject" type="expression" />
<attribute name="value" type="string"/>
<view name="img" resource="${this.resource}" y="2"/>
<method name="select">
selectionobject.setAttribute("selectedItem", this);
selectionobject.setAttribute("value", this.value);
edittext.idplantilla.setAttribute("text", this.value);
</method>

</class>

<class name="sel">
<attribute name="selectedItem" type="expression" value="null" />
<attribute name="value" type="string" value="0"/>
</class>
<view id="vistaCat" datapath="objetosDataset:/categorias/categoria">
<view>
<simplelayout axis="y" spacing="2"/>
<categoria id="listcate" datapath="@name" selectionobject="${catSeleccion}" resource="$path{'@resource'}">
<handler name="onclick"> <![CDATA[
this.setAttribute("value", this.data);
this.select();
]]> </handler>
<handler name="oninit">
</handler>

</categoria>
<text id="cate" align="center" datapath="@name" />
</view>
</view>
</canvas>


but I can't visualize the image. I only can read the text. The error is this:

#listcate cannot set resource to ..\KxonChak\objetos\figuras\loading.swf because it already has subviews.

Somebody knows how can I solve this?

Thanks,

Raquel

sulletf
10-18-2007, 12:39 AM
-hi

<view name="img" resource="${this.resource}" y="2"/>
<method name="select">

Should it not be

<view name="img" resource="${classroot.resource}" y="2"/>
<method name="select">

instead, as i guess you want the view to use categoria resource attribute ?