Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Aug 20, 2017 4:16 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Sun Jan 06, 2013 11:51 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Awesome! Just had that "trigger" moment I needed...will finish converting the rest of the jqueryui library...and, as always share :-) Thanks Greg! Btw I converted the TinyMCE control perfectly weeks ago during beta testing but for the life of me could not understand why the click event would not fire...Was forgetting basic jquery syntax..and thanks to Derk (swort) for clearing up some questions that were mucking up my learning progression. I got so use to using the undocumented portions of the framework that it kinda became a "mental block"... (and yes, it broke the controls after the websdk :-))..although before websdk, that was the only option for custom advanced controls..as for the iframe issue indeed there was a conflicting grease monkey script that was conflicting with the RS framework...not sure why or how...but once disabled, the iframe issue disappeared (with ctrl+F5)... I'm sure I'll have a firm understanding after converting the 30-something controls now. That constructor is tricky at first glance... Had to make an analogy while reading through it...But cross my fingers, after a nights sleep and a day of development..I just might have it down pat! Thank you guys!

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK: Not discouraged any longer
PostPosted: Mon Jan 07, 2013 12:04 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
One last question before setting out to conquer the jqueryui controls

In best practices would it be advisable to let's say...create a "core" class which contains a Boolean that is set to True after a first LoadLibrary is called within a particular set of control's namespace... And check to see if the Boolean has been set to true to prevent the jquery JavaScripts from being loaded multiple times? Just curious as to "best practices" as it would seem inefficient to load the files into the webapp for each control (messy and lots of overhead)...

Noticed in the jquery date picker example that if you add 3 date pickers to a page, the jquery lib loads 3 times..

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK: Not discouraged any longer
PostPosted: Mon Jan 07, 2013 2:24 am 
Offline
Real Software Engineer

Joined: Tue Jul 14, 2009 4:33 pm
Posts: 146
Location: Raleigh, NC
That's an oversight on our part. It's a little tricky when you think about it because you need to prevent the same session from repeatedly loading a framework, but you do want other sessions to load it. Here's what I'd suggest:

Add a shared property LoadedLibraries as Dictionary
In the Open event:
If LoadedLibraries = Nil then LoadedLibraries = New Dictionary


Anywhere you will be sending shared code to the browser:
Dim libName as string = "YourLibraryName"
If Not LoadedLibraries.HasKey(Session.Identifier + "_" + libName) then
...Load the library here...
LoadedLibraries.Value(Session.Identifier + "_" + libName) = True
End If


This will prevent two controls from sending the shared code to the browser. Remember this is for code that is not connected to any particular instance of your control.

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK: Not discouraged any longer
PostPosted: Mon Jan 07, 2013 9:24 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Stretch wrote:
That's an oversight on our part. It's a little tricky when you think about it because you need to prevent the same session from repeatedly loading a framework, but you do want other sessions to load it. Here's what I'd suggest:

Add a shared property LoadedLibraries as Dictionary
In the Open event:
If LoadedLibraries = Nil then LoadedLibraries = New Dictionary


Anywhere you will be sending shared code to the browser:
Dim libName as string = "YourLibraryName"
If Not LoadedLibraries.HasKey(Session.Identifier + "_" + libName) then
...Load the library here...
LoadedLibraries.Value(Session.Identifier + "_" + libName) = True
End If


This will prevent two controls from sending the shared code to the browser. Remember this is for code that is not connected to any particular instance of your control.


Awesome! I was curious as to how to setup some sort of identifier ensuring the prevention of multiloads in a session... As an oversight...will future releases of the sdk look to see if a particular library has previously been loaded (possibly disallowing multiple calls to the same library URLs?) to prevent problems in this area? Id like to "internalize" all checks within the controls so that users utilizing the controls won't have to take sessions into consideration...basically dropping the controlset into a project and just using them like native controls...the less work the users of the controlsets have to do to use them, the better :-)

Not sure if you've seen some of my previous collaborative works like eyeOS... But I'll be attempting to port the entire eyeOS framework (minus the implemented security protocol and ability to 'install' eyepackages (php dependent))to real studio as well...allowing users to create entire "virtual operating systems" within real studio...allowing for multiple "apps" within a single webapp... Which allows for windowed apps that appear just like desktop apps...reducing the need for a user to leave a page to access multiple apps simultaneously :-)

http://cloud.realdevspot.com

So many things to finish...days just aren't long enough :-)

Again, and as always, thank you Greg for all your help!

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK: Not discouraged any longer
PostPosted: Mon Jan 07, 2013 11:43 am 
Offline
Real Software Engineer

Joined: Tue Jul 14, 2009 4:33 pm
Posts: 146
Location: Raleigh, NC
Do me a favor, file a feature request for the centralized library thing.

LoadLibrary already does some lookups on the browser side. If the URL you request has already been requested, it just skips over that file.

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK: Not discouraged any longer
PostPosted: Mon Jan 07, 2013 1:13 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Stretch wrote:
Do me a favor, file a feature request for the centralized library thing.

LoadLibrary already does some lookups on the browser side. If the URL you request has already been requested, it just skips over that file.


Will do :-)

Aside: additional feature request - access to feedback system via web browser from our accounts (right now I'm on my iPhone...)

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK: Not discouraged any longer
PostPosted: Thu Jan 10, 2013 9:37 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Feedback: Centralized Javascript Library Checking to Ensure Only Single Instance of Library Loaded
For Reference: Case #23759

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK: Not discouraged any longer
PostPosted: Thu Jan 10, 2013 11:26 am 
Offline
Real Software Engineer

Joined: Tue Jul 14, 2009 4:33 pm
Posts: 146
Location: Raleigh, NC
Cool.

In the future, when making cases in feedback, please prefix the case with "WebSDK:"

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group