callback - refresh

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
k2R400
Profound User
Posts: 62
Joined: Sat Feb 18, 2012 12:03 pm
First Name: Patrick
Last Name: THOMAS
Company Name: Oo2
Country: France
Contact:

callback - refresh

Post by k2R400 »

Hello,

With the 5250 screens it was possible to attach a DTAQ and therefore allow a green screen to be refreshed on demand (and not by time interval).
I would like the same behavior with PUI, I will explain to you:

I have a PROG1 which displays a QRCODE.
When the user flashes this QRCode a PROG2 is called and asks the user to make a signature.
- How can my PROG1 know that PROG2 has been called?
- Do I have to make an Ajax request in my PROG1 every x seconds? Or is there a less resource intensive way?

Thank you
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: callback - refresh

Post by Scott Klement »

To me, this sounds like you're using a QRCode the way you would typically use other types of bar codes such as a UPC/EAN barcode. I don't think its really meant to be used that way? QRCodes are usually used like hyperlinks -- you scan them in order to open a web page.

That said, yes... if you wanted to make this work, you'd use an AJAX call to a back-end program that waits for the QRcode to be scanned. Instead of polling (checking every X seconds) you could consider using a long-wait type of design.. i.e., you do one AJAX call that sits and waits, maybe for several minutes... only only returns when the QRcode is finally scanned. This is much more efficient than polling every X seconds.

Unfortunately, there's no way to make a DTAQ work like green-screen. In order to make changes on the screen, an HTTP request must be initiated from the browser. Its not possible for the server to initiate a request to change the browser... that's not how HTTP works.
k2R400
Profound User
Posts: 62
Joined: Sat Feb 18, 2012 12:03 pm
First Name: Patrick
Last Name: THOMAS
Company Name: Oo2
Country: France
Contact:

Re: callback - refresh

Post by k2R400 »

Scott,
Thank you for the answer.
It is indeed a QRcode that I need, because I want to give the possibility to users to make a signature either with the mouse, or with their phone by scanning a qcrode which will open an anonymous (responsive) program.
Now the concern is to know when the user will have signed.
In your answer, what I have trouble understanding is: "you do one AJAX call that sits and waits, maybe for several minutes ..", I have a little trouble understanding how ...

Regards
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: callback - refresh

Post by Scott Klement »

You make an AJAX request... the AJAX request waits for a server-side API (could be an RPG program, PHP, Node.js, whatever is easiest for you). That program sits and waits for the QRCode. This may be a long wait, it is fine. When the QRCode is received, it returns back to the AJAX request, which updates the screen.
k2R400
Profound User
Posts: 62
Joined: Sat Feb 18, 2012 12:03 pm
First Name: Patrick
Last Name: THOMAS
Company Name: Oo2
Country: France
Contact:

Re: callback - refresh

Post by k2R400 »

Merci Scott !
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: callback - refresh

Post by Scott Klement »

De rien!
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests