Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 19, 2017 3:33 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: WebSDK: Not discouraged any longer
PostPosted: Fri Jan 04, 2013 12:27 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
I have played around with the WebSDK and am becoming quite discouraged. Code placed within SetupHTML ends up before the document <html> tag....where SetupJavascript and CSS should and do go...

so..I have managed to get a jQuery button to appear on a webpage..but cannot get any events (ie Click) to fire and I have read and can recite the WebSDK reference from memory at this point. Perhaps I just need a 'slight trigger' to grasp the control concept firmly...although its discouraging when after 4 hours the button still appears but does nothing...when I could have finished developing an entire webapp in PHP 2.5 hours ago...and just finishing up last touches..

Perhaps in place of demonstrating the date picker jquery control it would have been wise to demonstrate the "simplest" of controls first...(ie the plain simple old button)

here is the source:

http://www.realstudiodevspot.com/demos/button2.rbp

Perhaps someone can steer me in the right direction because this is an ABSOLUTE mess... it was easier developing controls using undocumented parts of the framework... but easiest is not always best :-)

_________________
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~


Last edited by simulanics on Sun Jan 06, 2013 11:52 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Fri Jan 04, 2013 12:06 pm 
Offline
Real Software Engineer

Joined: Tue Jul 14, 2009 4:33 pm
Posts: 146
Location: Raleigh, NC
I'll take a look at your project and let you know what's up.

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Fri Jan 04, 2013 12:28 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Greatly appreciated. Primarily my efforts to firmly grasp the concepts are so that I can contribute controls, tutorials, and answer questions others may have who contact me. Occasionally I encounter a "mental block" and require a little "show me" to break out of the block... :-) it seems the more complex something is..the easier it is..and the more
Simple..the harder it is to understand... Completely illogical.. But just how I operate :-)

Thanks!

_________________
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 Very Discouraging...
PostPosted: Fri Jan 04, 2013 3:14 pm 
Offline
Real Software Engineer

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

I just loaded your project and ran it on my machine and it loads and runs just fine. The HTML is being inserted exactly where it should be and your button appears correctly, assuming it is a dark blue button with rounded corners that turns light-blue when you roll over it. As far as I can see, the only thing that doesn't work is your Click event.

So far I've checked
Mac: Safari 6, Firefox 17 and Chrome 23
Win: IE8, IE9, IE10, Safari 6, Firefox 17 and Chrome 23

Knowing how the SDK works, I don't see any way that code for your control could be drawn before the html tags, unless you're injecting the code yourself, but the project you supplied certainly does not do that on my machines.

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Fri Jan 04, 2013 8:36 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Stretch wrote:
Matt,

I just loaded your project and ran it on my machine and it loads and runs just fine. The HTML is being inserted exactly where it should be and your button appears correctly, assuming it is a dark blue button with rounded corners that turns light-blue when you roll over it. As far as I can see, the only thing that doesn't work is your Click event.

So far I've checked
Mac: Safari 6, Firefox 17 and Chrome 23
Win: IE8, IE9, IE10, Safari 6, Firefox 17 and Chrome 23

Knowing how the SDK works, I don't see any way that code for your control could be drawn before the html tags, unless you're injecting the code yourself, but the project you supplied certainly does not do that on my machines.


I will post my custom HTMLviewer using iframe...when you view the source (at the moment it's only one line in htmlsetup

Return iframetag

And iframetag is obviously an iframe...when ran... The tag is directly before the <HTML> tag and the </iframe> disappears completely....

_________________
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 Very Discouraging...
PostPosted: Sat Jan 05, 2013 12:26 am 
Offline
Real Software Engineer

Joined: Tue Jul 14, 2009 4:33 pm
Posts: 146
Location: Raleigh, NC
I'd be interested to see that. When I do this:

return "<iframe src=""http://www.adobe.com""></iframe>"

It works exactly as expected.

Just remember: iFrames do funky things to browsers. There are rules about cross domain references and it's really easy to reference the wrong document in Javascript if you're not careful.

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Sun Jan 06, 2013 1:41 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
In the meantime I gave up...

The client settled for PHP... which was much faster, less cpu overhead, and quicker to develop and debug with their application... their application is complete...

websdk...not even a button functions...

best yet...

their app was still built with jquery...

Sorry Real Studio...this is one area too clunky to even begin developing with...

_________________
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 Very Discouraging...
PostPosted: Sun Jan 06, 2013 3:42 pm 
Offline
Real Software Engineer

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

I'm sorry you're having trouble with the WebSDK, but as I said in my previous message, your project works properly on my machine on all of our supported browsers. The only thing I can think of is that there was something else in your project that is conflicting with the SDK.

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Sun Jan 06, 2013 5:29 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Stretch wrote:
Matt,

I'm sorry you're having trouble with the WebSDK, but as I said in my previous message, your project works properly on my machine on all of our supported browsers. The only thing I can think of is that there was something else in your project that is conflicting with the SDK.



The issue is "click" event not iframe...that was a separate issue...for some reason events do not fire... The jquery button is the issue... I've tested it on Mac, windows, and Linux... No click event fires... Have tried onclick JavaScript event as well... In the date picker example onselect was used...that works fine and I've traversed the JavaScript during runtime and it fires properly... But when implementing the jquery button onclick is ignored...

_________________
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 Very Discouraging...
PostPosted: Sun Jan 06, 2013 5:34 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
By the way...forum text seems slightly impersonal and as I re-read the posts my messages sound "snooty" for lack of a 6-letter b word ..and apologies not intended... I'm just baffled because I know it should work...and I can watch the JavaScript process line by line..but something makes RS/JavaScript/the framework (one of them) completely ignore onclick in this instance... I've attempted simpler JavaScript with onclick and it works... And the same JavaScript example when migrated into RS just stops working. I'd love to be able to figure this out so I can help others as well... But I can't even help myself.

_________________
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 Very Discouraging...
PostPosted: Sun Jan 06, 2013 5:52 pm 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
Hey guys.

I don't use WE or the SDK (yet?) so I don't know about the SDK code but Matt in case you didn't realize I noticed your ExecuteEvent code only seems to execute one time when the page is first loaded. After that it never seems to execute which of course makes your code placed in there worthless.

Hope that helps you figure out what's gone wrong.


Stretch, how can you say it's working correctly when he isn't getting any of the button's events to execute?

Stretch can you get that click event for the button to execute correctly?

I'm sure that would be a big help.

I tested on Mac OS X 10.6.8 and Safari 5.1.7.


Btw, reloading the page has crashed it. More than once.

I also noticed double clicking the button creates a strange almost 50% of the button highlight.

weird.


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Sun Jan 06, 2013 8:41 pm 
Offline
Real Software Engineer

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

It looks like the problem is that your kConstructor code is not complete. kConstructor looks like this:

$(document).ready(function() {
$("#<<controlid>>").button();
});


and then in the MakeConstructor method, you do this:

Dim js As String = kConstructor

//figure out what options the user wants
Dim opts() As String
opts.Append "onclick: RSCustom.RSDS.jQuery.button.Click_<<controlid>>"

js = js.Replace("<<options>>", Join(opts,", "))
js = js.ReplaceAll("<<controlid>>", Self.ControlID)


I have a feeling that the fact that the constructor doesn't contain <<options>> means that your onclick code is not being sent to the browser.

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Sun Jan 06, 2013 8:46 pm 
Offline
Real Software Engineer

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

You are correct. My impression was that Matt was unable to get the control to go to the page at all and then when it did, it was rendering in the wrong place on the page. Both of these things are working correctly on my machine here.

The highlighting you see is the text getting selected. This is a common problem on the web with custom controls because they are often made up of text or other selectable objects. You can prevent this through the use of CSS:

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;


Just be careful not to apply this to text fields. If you do, you won't be able to select anything! (That's why we don't apply this globally to your app :) )

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Sun Jan 06, 2013 9:16 pm 
Offline
Real Software Engineer

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

I also figured out why your click event didn't fire. In MakeConstructor your code says:

opts.Append ".click(RSCustom.RSDS.jQuery.button.Click_<<controlid>>)"


Your framework code says:

RSCustom.RSDS.jQuery.button.click_<<controlid>> = function() {
RS.triggerServerEvent("<<controlid>>","Click");
}


It's a subtle bug. I looked at it 5 times :). Javascript is case-sensitive. The command in the options is "Click" whereas the name of the method is "click".

Also, to get the click event to work, I changed kConstructor to:

$(document).ready(function() {
$("#<<controlid>>").button()<<options>>;
});


and then the beginning of MakeConstructor to:

Dim opts() As String
opts.Append ".click(RSCustom.RSDS.jQuery.button.click_<<controlid>>)"

js = js.Replace("<<options>>", Join(opts,""))
js = js.ReplaceAll("<<controlid>>", Self.ControlID)

_________________
Greg O'Lone
Software Engineer
Real Software


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSDK Very Discouraging...
PostPosted: Sun Jan 06, 2013 10:23 pm 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
Looking pretty awesome!

Fantastic job Stretch!

After modding the code to what Stretch suggested the click event is executing properly now.

Both the ExecuteEvent select case code (from the Event Handlers) and the actual button's click event triggered (from the RaiseEvent Click call).



Thanks also to Simulanics (Matt) for always sharing his hard work!

Great job guys!

WE is looking better and better to me :)


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

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