Possible problem with basic handlers [message #759081] |
Sat, 26 November 2011 05:41 |
Dan Darnell Messages: 145 Registered: November 2011 Location: Arkansas |
Senior Member |
|
|
I encountered an issue with a large-ish application that I think I have boiled down into a simple example...
First, a working example. A simple basic handler and a RUI handler:
package com.dandarnell.life.client;
handler TestBasic
private state int;
function setState(state int in)
this.state = state;
end
function getState() returns(int)
return(state);
end
end
package com.dandarnell.life.client;
import org.eclipse.edt.rui.widgets.*;
handler TestRUI type RUIhandler{initialUI =[ui], onConstructionFunction = start, cssFile = "css/Test2.css"}
ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children =[l]};
l TextLabel { text = "state=nil", layoutData = new GridLayoutData {row=1, column=1} };
testBasic TestBasic[] = new TestBasic[2];
function start()
x int = testBasic[1].getState(); // <--- this works
l.text = x;
end
end
Now, the non-working example. No change to the basic handler. The difference in the RUI handler is a multi-dimensional array.
package com.dandarnell.life.client;
import org.eclipse.edt.rui.widgets.*;
handler TestRUI type RUIhandler{initialUI =[ui], onConstructionFunction = start, cssFile = "css/Test2.css"}
ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children =[l]};
l TextLabel { text = "state=nil", layoutData = new GridLayoutData {row=1, column=1} };
testBasic TestBasic[][] = new TestBasic[2][2]; //<------------------
function start()
x int = testBasic[1][1].getState(); //<--doesn't work
l.text = x;
end
end
Here's the runtime error:
Could not render UI
Object doesn't support this property or method
[CRRUI2094E] Here are the EGL function calls leading to this error:
com/dandarnell/life/client/TestRUI.egl() at line 13
TestRUI.<init>() [native JavaScript]
Line 13 is...
x int = testBasic[1][1].getState();
Interestingly, I have seen cases where this code is flagged as in-error in the editor. Clicking on the "X" shows an internal runtime exception. In other cases, no error in indicated in the editor but the runtime error occurs.
Also, it matters NOT that the code is in the onConstruction function. Anywhere I use similar code I get the error.
Am I doing something wrong or is this a bug?
--Dan
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03645 seconds