Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 14 total |
Project manager |
Tue, Jan 24 2012 12:31 PM | Permanent Link |
Robert Devine | Hi Tim
Couple of small bugs in Project manager (I'm using build from 24/1): 1. The "Add" button sometimes gets disabled and the only way to re-enable it is to restart the IDE (closing/re-opening project doesn't do it). 2. If I add a new unit via the menu then it doesn't immediately appear in the project mgr. Re-opening the project fixes it. BTW, the external JavaScript stuff works a treat. Cheers, Bob |
Tue, Jan 24 2012 8:07 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bob,
<< Couple of small bugs in Project manager (I'm using build from 24/1): >> Thanks, I'll make sure these are corrected. I still need to add context menu support to the Project Manager and collection editors, anyways. << BTW, the external JavaScript stuff works a treat. >> Cool. I need to add support for "other" external files like images that are just deployed with the project (as opposed to deployed and linked in the loader HTML), and then I can finish the deployment functionality. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Jan 24 2012 8:49 PM | Permanent Link |
Robert Devine | Hi Tim
Re the external Javascript - more of a support question really.. If I create some JS like this: function TestObject1() { } TestObject1.prototype.Sum = function(A, B) { return A + B; } I can easily reference it from EWB and call the sum method. However, I'm now trying to use some code where the objects are wrapped in a namespace with what appears to be Object Literal Notation, and having trouble. It's probably my poor JS knowledge (I'm trawling the docs now) but do I need to do anything else to tell EWB that the code of interest is in a namespace? Cheers, Bob On 25/01/2012 01:07, Tim Young [Elevate Software] wrote: > Bob, > > << Couple of small bugs in Project manager (I'm using build from 24/1): >> > > Thanks, I'll make sure these are corrected. I still need to add context > menu support to the Project Manager and collection editors, anyways. > > << BTW, the external JavaScript stuff works a treat. >> > > Cool. I need to add support for "other" external files like images that > are just deployed with the project (as opposed to deployed and linked in > the loader HTML), and then I can finish the deployment functionality. > |
Wed, Jan 25 2012 11:30 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bob,
<< I can easily reference it from EWB and call the sum method. However, I'm now trying to use some code where the objects are wrapped in a namespace with what appears to be Object Literal Notation, and having trouble. It's probably my poor JS knowledge (I'm trawling the docs now) but do I need to do anything else to tell EWB that the code of interest is in a namespace? >> Namespaces in JS are simply object wrappers around other objects. For example, if you had this JS: var AppSpace = AppSpace || {}; AppSpace.Podcast = function { this.title = 'Astronomy Cast'; this.description = 'A fact-based journey through the galaxy.'; this.link = 'http://www.astronomycast.com'; }; AppSpace.Podcast.prototype.toString = function() { return 'Title: ' + this.title; } from here: http://elegantcode.com/2011/01/26/basic-javascript-part-8-namespaces/ You would declare it in EWB as: interface external TPodCast = class public property title: String read write; property description: String read write; // These could be "read" only also, it depends upon how much access you want to allow - JS doesn't care, obviously property link: String read write; function toString: String; // Can be declared as virtual, also, if you want to override it later in a descendant class end; external TAppSpace = class public property PodCast: TPodCast read; end; var external AppSpace: TAppSpace; // This ensures that an instance of TAppSpace is always assumed to be present Finally, remember - JS is case-sensitive, so the external class/variable names must be correct or you'll get an error. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Jan 26 2012 5:49 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bob,
<< Couple of small bugs in Project manager (I'm using build from 24/1): 1. The "Add" button sometimes gets disabled and the only way to re-enable it is to restart the IDE (closing/re-opening project doesn't do it). >> This one is fixed. << 2. If I add a new unit via the menu then it doesn't immediately appear in the project mgr. Re-opening the project fixes it. >> Are you referring to *removing* a unit, perhaps ? I found a bug with the removal of units/forms, but not with adding them. Thanks, -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Jan 26 2012 7:11 AM | Permanent Link |
Robert Devine | Hi Tim
It happens when adding via the menu (i.e. File - New...). Still there on latest build (26/1). Cheers, Bob On 26/01/2012 10:49, Tim Young [Elevate Software] wrote: > Bob, > > << Couple of small bugs in Project manager (I'm using build from 24/1): > > 1. The "Add" button sometimes gets disabled and the only way to > re-enable it is to restart the IDE (closing/re-opening project doesn't > do it). >> > > This one is fixed. > > << 2. If I add a new unit via the menu then it doesn't immediately > appear in the project mgr. Re-opening the project fixes it. >> > > Are you referring to *removing* a unit, perhaps ? I found a bug with the > removal of units/forms, but not with adding them. > > Thanks, > |
Thu, Jan 26 2012 7:12 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bob,
<< It happens when adding via the menu (i.e. File - New...). Still there on latest build (26/1). >> Yep, I was using Add to Project, not File..New. Thanks, -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Jan 26 2012 11:17 AM | Permanent Link |
Robert Devine | Hi Tim
I created a simple one-level namespace and that seems to work ok. However, I should have mentioned that the (RemObjects) file I'm trying to use has a 2-level namespace. I've managed to get RO working where I've created a JavaScript wrapper class for the various RO SDK objects, and I pass callbacks into that from EWB. I'm now trying to call directly into the RO SDK (once I get this working I'll post both approaches as a sample). A snippet of the RO SDK is as follows: var RemObjects = {}; RemObjects.SDK = { ClientChannel : function ClientChannel(aUrl) { this.url = aUrl; }, HTTPClientChannel : function HTTPClientChannel(aUrl) { RemObjects.SDK.ClientChannel.call(this, aUrl); }, Message : function Message() { this.fClientID = RemObjects.UTIL.NewGuid(); this.fRequestObject = {}; this.fResponseObject = {}; }, JSONMessage : function JSONMessage() { RemObjects.SDK.Message.call(this); }, ..... } I now know enough about JS to understand the above. In my project I've got: external THTTPClientChannel = class public constructor Create(strUrl: string); end; external TJSONMessage = class end; external TSDK = class public property HTTPClientChannel: THTTPClientChannel read; property JSONMessage: TJSONMessage read; end; external TRemObjects = class public property SDK: TSDK read; end; var FormMain: TFormMain; external RemObj: TRemObjects; external SDK: TSDK; I don't think I'm declaring the above correctly because I can't get a combination that works. I'm trying to create an instance of an HTTPChannel object, e.g. FROChannel := THTTPClientChannel.Create('http://localhost:8099/json'); Not surprisingly I get an "HTTPClientChannel undefined" error with this since I don't have a reference to the namespace. The single-level namespace is easy enough. Cheers, Bob On 26/01/2012 04:30, Tim Young [Elevate Software] wrote: > Bob, > > << I can easily reference it from EWB and call the sum method. However, > I'm now trying to use some code where the objects are wrapped in a > namespace with what appears to be Object Literal Notation, and having > trouble. It's probably my poor JS knowledge (I'm trawling the docs now) > but do I need to do anything else to tell EWB that the code of interest > is in a namespace? >> > > Namespaces in JS are simply object wrappers around other objects. For > example, if you had this JS: > > var AppSpace = AppSpace || {}; > > AppSpace.Podcast = function { > this.title = 'Astronomy Cast'; > this.description = 'A fact-based journey through the galaxy.'; > this.link = 'http://www.astronomycast.com'; > }; > > AppSpace.Podcast.prototype.toString = function() { > return 'Title: ' + this.title; > } > > from here: > > http://elegantcode.com/2011/01/26/basic-javascript-part-8-namespaces/ > > You would declare it in EWB as: > > interface > > external TPodCast = class > public > property title: String read write; > property description: String read write; // These could be "read" only > also, it depends upon how much access you want to allow - JS doesn't > care, obviously > property link: String read write; > function toString: String; // Can be declared as virtual, also, if you > want to override it later in a descendant class > end; > > external TAppSpace = class > public > property PodCast: TPodCast read; > end; > > var > external AppSpace: TAppSpace; // This ensures that an instance of > TAppSpace is always assumed to be present > > Finally, remember - JS is case-sensitive, so the external class/variable > names must be correct or you'll get an error. > |
Fri, Jan 27 2012 7:39 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bob,
<< However, I should have mentioned that the (RemObjects) file I'm trying to use has a 2-level namespace. I've managed to get RO working where I've created a JavaScript wrapper class for the various RO SDK objects, and I pass callbacks into that from EWB. I'm now trying to call directly into the RO SDK (once I get this working I'll post both approaches as a sample). A snippet of the RO SDK is as follows: >> The problem here is that EWB does not support class methods yet, which is what the JSONMessage, HTTPClientChannel, etc. members are, once translated from JS. In EWB, they would need to be expressed as class constructors that return instances of the individual class types that are being declared. Basically, you're going to have this problem with any structure in JS that nests constructors. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Jan 27 2012 2:48 PM | Permanent Link |
Robert Devine | Hi Tim
Ok, thanks, that explains why what appeared to be a sensible approach didn't work. It's not a major problem - I can write a simple JS module that flattens the RO one with the few classes I need re-exposed. Cheers, Bob On 27/01/2012 12:39, Tim Young [Elevate Software] wrote: > Bob, > > << However, I should have mentioned that the (RemObjects) file I'm > trying to use has a 2-level namespace. I've managed to get RO working > where I've created a JavaScript wrapper class for the various RO SDK > objects, and I pass callbacks into that from EWB. I'm now trying to call > directly into the RO SDK (once I get this working I'll post both > approaches as a sample). > > A snippet of the RO SDK is as follows: >> > > The problem here is that EWB does not support class methods yet, which > is what the JSONMessage, HTTPClientChannel, etc. members are, once > translated from JS. In EWB, they would need to be expressed as class > constructors that return instances of the individual class types that > are being declared. Basically, you're going to have this problem with > any structure in JS that nests constructors. > |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Friday, December 6, 2024 at 05:39 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |