puneetht
04-28-2008, 09:50 PM
I have a user defined class which is supposed to display an image which it gets from the server. I get the data from the server. I display the image using the following code
in the main view.
count = count + 1;
var imgView = new image_ entry(canvas['image_view'],{x:50,width:150,creator:v_creator,sender:v_sender ,image_loc:v_image_loc,soc_net:v_soc_net,creat_tim e:v_creat_time});
imgView.load_wall_image();
image_entry is a class by itself. The code for the class is below
<class name="image_entry" extends="view" opacity="1" >
<attribute name="creator" type="string" value="" />
<attribute name="image_loc" type="string" value="" />
<attribute name="soc_net" type="string" value="" />
<attribute name="creat_time" type="string" value="" />
<image name="img" stretches="both" >
<attribute name="width" value="150" />
<attribute name="aspect" value="${unstretchedheight/unstretchedwidth}" />
<attribute name="height" value="${width * aspect}" />
</image>
<method name="load_wall_image">
Debug.write("Image is " + this.getAttribute('image_loc'));
this.img.setSource(this.getAttribute('image_loc')) ;
Debug.write("Loaded " + this.getAttribute('image_loc'));
</method>
</class>
The image never really appears in the image_entry. Even though the source of teh image attribute is set correctly. I cannot see the image in the browser. Can someone please tell me what I am doing wrong.
in the main view.
count = count + 1;
var imgView = new image_ entry(canvas['image_view'],{x:50,width:150,creator:v_creator,sender:v_sender ,image_loc:v_image_loc,soc_net:v_soc_net,creat_tim e:v_creat_time});
imgView.load_wall_image();
image_entry is a class by itself. The code for the class is below
<class name="image_entry" extends="view" opacity="1" >
<attribute name="creator" type="string" value="" />
<attribute name="image_loc" type="string" value="" />
<attribute name="soc_net" type="string" value="" />
<attribute name="creat_time" type="string" value="" />
<image name="img" stretches="both" >
<attribute name="width" value="150" />
<attribute name="aspect" value="${unstretchedheight/unstretchedwidth}" />
<attribute name="height" value="${width * aspect}" />
</image>
<method name="load_wall_image">
Debug.write("Image is " + this.getAttribute('image_loc'));
this.img.setSource(this.getAttribute('image_loc')) ;
Debug.write("Loaded " + this.getAttribute('image_loc'));
</method>
</class>
The image never really appears in the image_entry. Even though the source of teh image attribute is set correctly. I cannot see the image in the browser. Can someone please tell me what I am doing wrong.