NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rene Simons on December 07, 2018, 03:47:32 AM

Title: json straight into NetWebBrowse
Post by: Rene Simons 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
Title: Re: json straight into NetWebBrowse
Post by: DonRidley 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
Title: Re: json straight into NetWebBrowse
Post by: Rene Simons 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
Title: Re: json straight into NetWebBrowse
Post by: DonRidley 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
Title: Re: json straight into NetWebBrowse
Post by: Bruce 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
Title: Re: json straight into NetWebBrowse
Post by: DonRidley 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.