[Laszlo-user] "Call By Name"-Problem of <text>-Component being in <gridcolumn>

Marc Bachstein bachstein at visus-tt.com
Mon Apr 28 05:45:51 PDT 2008


Hello,

I want to call a <text>-Component by name, which is in a
<gridcolumn>-Component. The compiler gives here an error:

"Debug.evalCarefully("ChangingAttributesInText.lzx" , 7, function () {return
myText;}, this) has no properties"

If the <text>-Component is in a <view>-Component there is no compiler error
and it works fine.

Can anybody tell me, how I can call the <text>-Component here by name?

Here are the source codes:

This works:
-----------------------------------------------------------------
<canvas debug="true" >
	<class name="myClass" extends="view">

		<text name="myText" multiline="false" width="0"/>

		<handler name="oninit">
			myText.setText("Hello!");
		</handler>			
	</class>

	<view name="View">
		<handler name="oninit">
			var A = new myClass(this,{});
		</handler>
	</view>
</canvas>
-----------------------------------------------------------------

Here the compiler gives an error:
-----------------------------------------------------------------
<canvas debug="true" >
	<class name="myClass" extends="gridcolumn">

		<text name="myText" multiline="false" width="0"/>

		<handler name="oninit">
			myText.setText("Hello!");
		</handler>			
	</class>

	<view name="View">
		<grid>
			<handler name="oninit">
				var A = new myClass(this,{});
			</handler>
		</grid>			
	</view>
</canvas>
-----------------------------------------------------------------

Kind Regards,
Marc




More information about the Laszlo-user mailing list