CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

TIWCGJQAjaxBrowserHistory mobile example

General discussion

by magosk » 03 Jan 2014 14:45

Hi again! Just me trying another of the core components without any success ;-)

On a newly created (simple) mobile page, I have a header left button with some code in its Events.OnVClick.OnEvent (AJAX) handler. I would like to trigger this code also when user clicks the browser back button (and preferably also when using the Android back button). I have dropped a TIWCGJQAjaxBrowserHistory component on this form, and I assume I should set its Hash property to something suitable, either at design time or when the form is created? I tried with LeftButton.ID but this did not work (although I noticed that the OnHashChange event was triggered on the server side about a second after the form was created). If you have a simple example to get me going in the right direction, I would be much grateful. I looked at http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/, but my experience in pure web programming is unfortunately too poor in order to translate this to the IntraWeb case.

Also, after a while I get the error message "Only 15 minutes allowed in IWCGJQ Controls evaluation mode". I thought we were allowed to use the core components through our license for the mobile components?
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Jorge Sousa » 03 Jan 2014 15:11

Hi magosk

Please check how it's done in jQueryDemo14_V2

The Hash property is only the default or the main Hash

You've to add hashes yourself to mark a stage in your app, and use OnHashChange to restore to a previsous stage, also with your code.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by magosk » 03 Jan 2014 16:59

cgdevtools_support wrote:Hi magosk

Please check how it's done in jQueryDemo14_V2

The Hash property is only the default or the main Hash

You've to add hashes yourself to mark a stage in your app, and use OnHashChange to restore to a previsous stage, also with your code.


Thanks, although I cannot run the demo I could look at the code, and this has got me started in the right direction. The license issue is vital however, can you solve this?
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Jorge Sousa » 03 Jan 2014 17:18

Hi

The license issue is vital however, can you solve this?


I'm sorry, but it's not possible.

The code that is on jqueryDemo14_V2 only has meaning for the demo itself, the main concept is mark and restore stages.

I believe you can run the jQueryDemo14_V2, just not save opened frames/forms, if you don't change anything you're able to run it and even debug it, disgarding the component not found errors .
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by magosk » 07 Jan 2014 11:23

cgdevtools_support wrote:Hi

The license issue is vital however, can you solve this?


I'm sorry, but it's not possible.

The code that is on jqueryDemo14_V2 only has meaning for the demo itself, the main concept is mark and restore stages.

I believe you can run the jQueryDemo14_V2, just not save opened frames/forms, if you don't change anything you're able to run it and even debug it, disgarding the component not found errors .


Hi again, perhaps I was unclear: running the demo is not that important to me, but being able to use TIWCGJQAjaxBrowserHistory in a mobile project (without getting license errors) is. As I understood from earlier discussions, it is a core component and should thus be allowed to be used also when you (like us) only have a license for the mobile components? (I get the error in my mobile web app). EDIT: I saw your reply in the other thread that you now have a mobile specific version. I will test this. (The question below remains though)

Also, a more technical question: if you have a project with multiple (simple) mobile web forms, should you use a component on each of the forms, or should you use a common on placed e.g. in the user session?
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Jorge Sousa » 07 Jan 2014 12:19

Hello

We had already made a TIWCGJQMAjaxBrowserHistory to be used in Mobile Web Apps.

Also, a more technical question: if you have a project with multiple (simple) mobile web forms, should you use a component on each of the forms, or should you use a common on placed e.g. in the user session?


I think you are mixing two things: One is
Ajax
Browser History, that we provide, another is back button support that Intraweb should provide.

You have to drop an TIWCGJQMBrowserHistory component in each form, since it's not possible to change IW forms in ajax events.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by magosk » 10 Jan 2014 08:57

Hi!

Just wanted to tell you that I finally got it to work fine, also with a sequence of "dialog style forms" with a header left "back" button. The key was triggering a one-time async timer after creation of the dialog form, and also when returning to it when coming back from the "next dialog in the sequence". In the timer event handler I make an AddHash call, and then I can check the HashChange event (when the previously added hash is missing, there has been a browser back button click, and I can call the header left button VClick event handler from code). It all boiled down to a few lines of code in my base class for "dialog style forms". Thanks for your support on this!
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.