Profound UI - Mobile Client - Strange Message

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Mark Smart
Profound User
Posts: 22
Joined: Tue Apr 14, 2015 9:30 am
First Name: Mark
Last Name: Smart
Company Name: Anker International
Contact:

Profound UI - Mobile Client - Strange Message

Post by Mark Smart »

Hi All,

I've started receiving this message, on an onClick event, in the Mobile Client.
https://onedrive.live.com/redir?resid=9 ... hoto%2cpng

Does anybody know what it means and why I'm receiving it?

Thanks,

Mark
Antonio
Profound User
Posts: 82
Joined: Fri Jun 29, 2012 2:33 pm
First Name: Antonio
Last Name: Ruballos
Company Name: Profound Logic
Contact:

Re: Profound UI - Mobile Client - Strange Message

Post by Antonio »

Hello Mark,

Are you receiving this for all your onclick events or just a specific one? Is it possible to provide me with a copy of your Rich Display File and point me to the element in question who's onclick event is giving you this error?

To grab a copy of your RDF, simply open up the screen in the designer, select "Save As" at the top of the designer, select the local tab and and save the file on your local PC. Then you can attach that file in a comment here and we can have a look at it and being debugging your issue.

Thanks!
Mark Smart
Profound User
Posts: 22
Joined: Tue Apr 14, 2015 9:30 am
First Name: Mark
Last Name: Smart
Company Name: Anker International
Contact:

Re: Profound UI - Mobile Client - Strange Message

Post by Mark Smart »

Hi Antonio,

I've managed to find the problem. The classic "forgot semi-colon at end of line in JavaScript" issue.

Thanks,

Mark
Antonio
Profound User
Posts: 82
Joined: Fri Jun 29, 2012 2:33 pm
First Name: Antonio
Last Name: Ruballos
Company Name: Profound Logic
Contact:

Re: Profound UI - Mobile Client - Strange Message

Post by Antonio »

Glad to hear you resolved the issue. At least the issue proved to be simple!
Mark Smart
Profound User
Posts: 22
Joined: Tue Apr 14, 2015 9:30 am
First Name: Mark
Last Name: Smart
Company Name: Anker International
Contact:

Re: Profound UI - Mobile Client - Strange Message

Post by Mark Smart »

Hi Antonio,

I'm afraid I was wrong with my previous diagnosis.
The message is displayed when I perform an ajax() call from the mobile client.
Mobile and desktop browsers are fine.

All parameters have a value, and I need the call to be synchronous as I need data returned before continuing, hence no handler defined.
I've tried debugging in WDS client, but it doesn't break, so I don't think it's being called. HTTP Error logs don't give any clues.

Code: Select all

    result = ajax({
     url: "/profoundui/universal/pickValidation",
     params: {
       REQTYP: inReqTyp,
       REQVAL: inReqVal,
       COMP  : inComp, 
       ORDNUM: inOrdNum,
       DSPSEQ: inDspSeq,
       LSTLOC: inLstLoc,
       LSTSKU: inLstSku,
       LSTQTY: inLstQty,
       ORGLOC: inOrgLoc,
       ORGSKU: inOrgSKU,
       ORGQTY: inOrgQty,
       JOBNAM: inJobNam,
       JOBNUM: inJobNum,
       JOBUSR: inJobUsr
     },
     method: "post",
     async: false
    });

Do I need to do something different when using ajax() from the mobile client?

Thanks in advance.

Best regards,

Mark
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 - Strange Message

Post by Scott Klement »

You may need to normalize the URL as described here:
http://www.profoundlogic.com/docs/pages ... Id=7602181

For example:

Code: Select all

    result = ajax({
     url: pui.normalizeURL("/profoundui/universal/pickValidation"),
       .... etc ...
Long-winded explanation follows:

To understand this: HTTP has "absolute" vs "relative" URLs.

An absolute URL means that you hard-code the protocol, server name and port into the URL like "http://mysystem:8080/profoundui/univers ... Validation". Coding this in your "url" parameter would not be good because you can't easily move the code to another system or port because you have the system name hard-coded into the URL.

A relative URL looks like your example "/profoundui/universal/pickValidation" Notice that it has no "http" or "mysystem" or port number (8080). The browser will automatically use the protocol/address/port that the web web was served from since it was not provided. This means you don't have to hardcode these things in your application, which is a good thing.

However, in the case of the mobile client, the first web page it shows does NOT come from your server -- it comes from files stored inside the app on your mobile device. If you are using our mobile client, these are the files that show the screens where you pick the server from, etc. So if you use a relative URL, it'll think your pages are also stored on the mobile client itself since that's where the pages started. If you are creating your own app with PhoneGap, then you specified an "index.html" or similar file in the phonegap configuration (or possibly used the prewritten one in our template -- but it amounts to the same thing, you have an HTML file in the app itself.)

In either case, calling pui.normalizeURL() should solve it. This API was provided so that you don't have to hard-code the system name/port in your applications. This API will interrogate the pui.serverURL variable (which would've been by the mobile client or your JS file if you made your own app) and build an absolute URL on-the-fly. That way, you can access a different system (via absolute URL) without hard-coding the URL inside your application.

Is that what's going on, here?
Mark Smart
Profound User
Posts: 22
Joined: Tue Apr 14, 2015 9:30 am
First Name: Mark
Last Name: Smart
Company Name: Anker International
Contact:

Re: Profound UI - Mobile Client - Strange Message

Post by Mark Smart »

Thank you Scott.
Normalising the URL has worked.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests