NetTalk Central

Author Topic: json straight into NetWebBrowse  (Read 5904 times)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
json straight into NetWebBrowse
« on: December 07, 2018, 03:47:32 AM »
Hi,

Is it possible or is there a way to move json data straight into a NetWebBrowse?  Or do I need to move the data into a memory table first?

Cheers,
Ren?

C11
NT11.04
Rene Simons
NT14.14

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: json straight into NetWebBrowse
« Reply #1 on: December 09, 2018, 12:45:14 PM »
If you have jFiles you could load your JSON into a memory table and display in a browse.  Haven't done that myself but think it would be possible.

You could also load into a QUEUE and get and display the data in a field or fields in an existing browse.  The browse field itself would just be a field with only an equate. Probably as a string type.  In that field's value::somefield routine do seomthing like:

 packet.Append(myloadedJSONdata)

Seems doable.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: json straight into NetWebBrowse
« Reply #2 on: December 09, 2018, 10:27:07 PM »
Thanks Don,

I had figured that solution out already but was hoping for a more direct approach.
You mentioning the Queue option surprises me a bit. I Always thought that queues are not thread safe and therefore have to be avoided in NTWS.

Btw, I am looking forward to your presentation on apps on the 21st this month, as are probably a lot of people  ;).
No pressure there huh ?

Kind regards,

Ren
« Last Edit: December 10, 2018, 01:53:12 AM by Rene Simons »
Rene Simons
NT14.14

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: json straight into NetWebBrowse
« Reply #3 on: December 10, 2018, 02:45:53 AM »
I think a queue in a local procedure would be pretty safe.  A qlobal queue?  Not so much.

Yeah, the most "direct" approach may be dropping the JSON in a mem table.  Fortunitly jFiles handles that well.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: json straight into NetWebBrowse
« Reply #4 on: December 11, 2018, 04:14:51 AM »
>> I think a queue in a local procedure would be pretty safe.

Useful in NetWebServiceMethods - not useful in Browses and Forms because those are "Event Handlers" not procedures.

cheers
Bruce

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: json straight into NetWebBrowse
« Reply #5 on: December 11, 2018, 05:01:28 AM »
not useful in Browses and Forms because those are "Event Handlers" not procedures.

cheers
Bruce

Ah.  Yes.  Good point.
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11