|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Tutorial - Access a database [message #789442 is a reply to message #789117] |
Fri, 03 February 2012 01:23 |
fahua jin Messages: 58 Registered: July 2011 |
Member |
|
|
Bernard Harris wrote on Thu, 02 February 2012 11:15One thing I noticed, while copying in the code for the SQLService.egl, is I couldn't see any SQL statement when using Ctrl+1 on the "get" statement in getAllPayments(), whereas I could see the SQL statements in addPayment, editPayment, and deletePayment.
Hi Bernard,
Hope you can finally get the tutorial run successfully, and feel free to ask here if having any problems.
For your problem of Ctrl + 1 cannot generate the SQL statements, we have a bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=369021) opened for this, and it will be resolved soon.
Rocky
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Tutorial - Access a database [message #836575 is a reply to message #836539] |
Wed, 04 April 2012 16:48 |
Doctor Hung Messages: 7 Registered: February 2012 |
Junior Member |
|
|
Hi!
After changing the line as following, the problem fixed. But I don't know why some programmer pass the compilation even without putting the interface name there.
call SQLService.getAllPayments() using new HttpProxy("services.SQLService") returning to updateAll onException serviceExceptionHandler;
Back to the formatter error. The source is as following. What is wrong with formatters = [ formatCategory ] ? This has no problem when we use version 0.7
columns =[
new DataGridColumn{name = "category", displayName = "Type",
width = 90, formatters = [ formatCategory ]},
new DataGridColumn{name = "description", displayName = "Description",
width = 120},
new DataGridColumn{name = "amount", displayName = "Amount due",
width = 90, alignment = DataGridLib.ALIGN_RIGHT}
],
|
|
|
Re: Tutorial - Access a database [message #836625 is a reply to message #836575] |
Wed, 04 April 2012 18:04 |
Justin Spadea Messages: 66 Registered: July 2009 |
Member |
|
|
As you've observed, when using an interface in the call statement you must supply the implementation name (this is not required if referencing the service part directly). It's valid syntax to leave the implementation name out, therefore you do not get a validation error, and instead get a runtime error. An example as to why it can't be a validation error would be you have defined your own type of IHTTP that does not have such a requirement. It would be like getting a validation error because you are assigning a string field to an integer field, and the string field contains non-numeric data; this is valid syntax and would only fail at runtime.
As for the formatter error, this is due to a change we made I think in 0.8 M3 where the string type is now a reference type instead of a value type, meaning its default parameter modifier has changed from INOUT to IN. The CellFormatter delegate defines the parameters to be of type INOUT, therefore you must change your function signature to: function formatCategory(class string inout, value string inout, rowData any in)
Right now the tutorial has it use the default modifier, which is no longer INOUT, and thus doesn't match the definition of CellFormatter.
I've updated the tutorial for this change so that it's once again without error. Let me know if you have any other questions!
-Justin
|
|
|
|
|
|