Profound UI mobile client

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Profound UI mobile client

Post by Paul_Ramcharitar »

Hi,

I am using the profound ui mobile client to run programs. However, it is noticed that images loaded from the IFS via image widget for example, are not coherent with the latest version of the image stored.

I have to go into "app info" then "clear data" for the correct images to be loaded.

How can I allow the mobile client to load the latest version of the image?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Profound UI mobile client

Post by Scott Klement »

Web browsers (including the mobile client) cache images for performance sake. The result is that you'll get an old copy of the image unless you do something to avoid that.

Try setting your image source property to something lke this:

Code: Select all

script: pui.normalizeURL("/tempimages/" + get("PATID") + ".jpg?rnd=" + Math.random());
Naturally the URL to your imge will be different, mine is /tempimages/XXXXX.jpg (where XXXXX is a patient id number). This code adds ?rnd=YYYYYYYYY (where YYYYYYYY is a random number) to the end of the URL. Because the ? was added, it won't consider the rnd= part of the filename... but the fact that the URL changes each time will prevent the browser from caching it.

Hope that helps
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Profound UI mobile client

Post by Paul_Ramcharitar »

Hi Scott,

The image url is set in the program via binded image source property. I decided to use the RPGLE rand() function

Code: Select all

rnd_num = '?rnd='+%char(Rand()); 

phot_src2# = %TRIM(DUCSRCDIR) + %CHAR(cmnumb#) + %trim(DUCSUFFIX)+rnd_num;
It is working in the web browser however, the image still does not change in the mobile client.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Profound UI mobile client

Post by Scott Klement »

Are you returning to the RPG program and updating the image URL with a new random number each time you want the image to re-load from the IBM i? If so, what you're doing should work fine.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Profound UI mobile client

Post by Paul_Ramcharitar »

I got it. I had to seed the random number using srand.

Thanks Scott.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests