Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Response.Result as AURL

 Post Reply Post Reply
Author
Karlheinz Munz View Drop Down
New Member
New Member
Avatar

Joined: 14 Sep 2019
Posts: 29
Post Options Post Options   Quote Karlheinz Munz Quote  Post ReplyReply Direct Link To This Post Topic: Response.Result as AURL
    Posted: 11 Nov 2019 at 10:56am
Hello,

I get a Response.Result from a service and like to load it via LoadFromJSon to a TWebStringGrid.

procedure TForm1.btnJSArrayClick(Sender: TObject);
   procedure OnResponse(Response: TXDataClientResponse);
   begin
      Grid_Abteilung.LoadFromJSON(); //AURL?
   end;
begin
   XMyClient.RawInvoke('IData_xChangeService.Get_Abteilung_JSArray',[], @OnResponse);
end;

Is it possible to link the Resonse.Result (TJSONArray) as an AURL to the LoadFromJSON of the TWebStringGrid?

Many thanks
Patrick

Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2546
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 11 Nov 2019 at 5:37pm
Can't you just manually provide the directly URL of IData_xChangeService.Get_Abteilung_JSArray method to the LoadFromJSON method?
Back to Top
Karlheinz Munz View Drop Down
New Member
New Member
Avatar

Joined: 14 Sep 2019
Posts: 29
Post Options Post Options   Quote Karlheinz Munz Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 7:02pm
Perfect! In my example case it is 'http://localhost:8000/tms/xdata/Data_xChangeService/Get_Abteilung_JSArray'

Greetings Patrick
Back to Top
Karlheinz Munz View Drop Down
New Member
New Member
Avatar

Joined: 14 Sep 2019
Posts: 29
Post Options Post Options   Quote Karlheinz Munz Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 4:37pm
One more question. I am missing the Col Titles. I have a JSArray like below:
[
    {
        "AbteilungsID": 10,
        "Abteilung": "Verkauf",
        "Test": "0"
    },
    {
        "AbteilungsID": 20,
        "Abteilung": "Anwendung & Entwicklung",
        "Test": "0"
    }
]

But in the fixed frist Row I have not "AbteilungsID", "Abteilung", "Test". Can I insert the, too?

Many thanks.

P.S.: It is cool that this also works:
WebMemo_Stream.Lines.LoadFromFile('http://localhost:8000/tms/xdata/Data_xChangeService/Get_Abteilung_JSArray');

If someone is interested...
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2546
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 19 Nov 2019 at 1:09am
That's up to the server-side. I don't know how your server-side is implemented.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down