[RPG-HTML] Off line

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
Fabrice Geay
Posts: 13
Joined: Fri Apr 05, 2013 8:33 pm
Location: France - Valence

[RPG-HTML] Off line

Post by Fabrice Geay »

In the offline mode, i would change the HTML page to add images and css. Can i do that and how ?
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: [RPG-HTML] Off line

Post 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.
Fabrice Geay
Posts: 13
Joined: Fri Apr 05, 2013 8:33 pm
Location: France - Valence

Re: [RPG-HTML] Off line

Post by Fabrice Geay »

I am not into the beta testing group, so my request is for the existing offline examples.
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: [RPG-HTML] Off line

Post 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.
Fabrice Geay
Posts: 13
Joined: Fri Apr 05, 2013 8:33 pm
Location: France - Valence

Re: [RPG-HTML] Off line

Post 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 ?
Attachments
Folder.PNG
Folder.PNG (42.75 KiB) Viewed 6742 times
Schemas.PNG
Schemas.PNG (19.07 KiB) Viewed 6742 times
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: [RPG-HTML] Off line

Post 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.
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: [RPG-HTML] Off line

Post by MarkDuignan »

How are you referencing the files in your HTML document?

Could you post the HTML you are using?
Fabrice Geay
Posts: 13
Joined: Fri Apr 05, 2013 8:33 pm
Location: France - Valence

Re: [RPG-HTML] Off line

Post 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
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: [RPG-HTML] Off line

Post by MarkDuignan »

Thanks for putting the solution on the forum.
Post Reply