Page 1 of 1

[RPG-HTML] Off line

Posted: Mon Sep 30, 2013 5:09 pm
by Fabrice Geay
In the offline mode, i would change the HTML page to add images and css. Can i do that and how ?

Re: [RPG-HTML] Off line

Posted: Mon Sep 30, 2013 5:31 pm
by MarkDuignan
When you say ‘offline’ – do you mean

(1) the brand new LongRange offline capability - currently being trialed by some beta sites.
=or=
(2) the existing offline examples shipped withLongRange RPG shipped demo loading webviews from the /LongRange/resources folder and the other shipped Advanced Web View examples.

If (1) - please send your questions to the beta testing email group.

Re: [RPG-HTML] Off line

Posted: Mon Sep 30, 2013 6:34 pm
by Fabrice Geay
I am not into the beta testing group, so my request is for the existing offline examples.

Re: [RPG-HTML] Off line

Posted: Tue Oct 01, 2013 8:57 am
by MarkDuignan
Put you JS, CSS and HTML files into your <root>/LongRange/Resources folder.

In LR Studio define a webview in your schema that will load up your start up HTML page (eg: like the web view named EXAM0026 in the shipped LongRangeDemo).

In that webview definition add the other JS, CSS and HTML files to the ‘Required Resources’ list.

Remember that all these resources are loaded at schema reload/refresh time. So when you change them you need to reload/refresh your schema – so starting to develop & test in a small schema can save refresh/reload time.

Re: [RPG-HTML] Off line

Posted: Tue Oct 01, 2013 5:18 pm
by Fabrice Geay
Thank you Mark,
see in attachment my schema and the <root>/LongRange/Resources folder.
But when i refresh my schema on the iPad, this does not work.
What i have miss ?

Re: [RPG-HTML] Off line

Posted: Tue Oct 01, 2013 5:41 pm
by MarkDuignan
Using a user profile with appropriate authority execute this command:

CHGAUT OBJ('/<AXES-FOLDER>/LongRange/Resource/*.*') USER(*PUBLIC) DTAAUT(*R) OBJAUT(*NONE)

Now check that a test file has user *PUBLIC having *R (and only *R) rights to the file:

WRKLNK OBJ('/<AXES-FOLDER>/LongRange/Resource/gerneral.js')

Then use 9=Work with authority and check *PUBLIC has *R (and only *R) rights.

If that does not fix it I would try something simpler that has (say) verify.html bringing in verify.js - that does just alert("Hello");

If that does not work try producing a client log and see what it says about the reload/refresh attempt.

If that does not solve the problem then there is a product called iExplorer (http://www.macroplant.com/iexplorer/) that will allow you to look at the files on your iPhone or iPad - you can use that to determine exactly what is in your iPad or iPhone's resource cache.

Re: [RPG-HTML] Off line

Posted: Tue Oct 01, 2013 5:46 pm
by MarkDuignan
How are you referencing the files in your HTML document?

Could you post the HTML you are using?

Re: [RPG-HTML] Off line

Posted: Tue Oct 01, 2013 6:59 pm
by Fabrice Geay
I have solved my issue with Jurgen.
First point :
I did not reference the resources properly.
my code :<script type="text/javascript" src="table_CATEGORIE.js"></script>
Correct code : <script type="text/javascript" src="app/resources/table_CATEGORIE.js"></script>

Second Point :
Sometimes it seems the LongRange API is not loaded completely and you will get javascript errors.
Jurgen has added to my code a timer
<script type="text/javascript">
window.onload = function () {setTimeout(Init(),200);}
function Init()
{ var tmp_Maint = new TDEF_QuickMaint.init(TDEFINE_CONTACT, "TableContainer");}
</script>


And now, it is working well

Re: [RPG-HTML] Off line

Posted: Wed Oct 02, 2013 8:31 am
by MarkDuignan
Thanks for putting the solution on the forum.