Notice

The forum is in read only mode.

  • Page:
  • 1

TOPIC: Adapter does not have a Response component

Adapter does not have a Response component 7 years 2 months ago #1231

Anyone seen that this error message does appear when using REST components on the "Header/Footer with Navigation" and "Tabbed with Navigation" application templates, but it will not appear when using REST components on simple application templates like "Blank" and "Header/Footer".

And what is causing this behavior?

Using Appmethod / C++.

Suggested path to recreate the "Adapter does not have a Response component" error message.

0. Make two applications (a and b) separatly, and follow the paths as described below. Follow "a" first, and there after "b".

1. Create New application:
1.a. File->New->"Multi Device Application - C++"->"Blank Application"
1.b. File->New->"Multi Device Application - C++"->"Header/Footer with Navigation"

2. Drag following components from Tool Palette onto the applications form: "TRESTClient", "TRESTRequest" , "TRESTResponse", "TRESTResponseDataSetAdpater" and "TFDMemTable", they are named automatically...

3. Drag following component from Tool Palette onto the applications form, and resize it to your needs: "TStringGrid"

Note: The "REST" settings here points to an API at " www.tileblock.com/userdata ", which will be available for some weeks, if you get 404 error messages, check typing, if correct, post an answer to me and I can enable the API again. The API will only respond to GET towards condbtest.php. The resulting set should be a JSON. For this test, no credentials are needed. Data is only examples, email adresses shown are not valid, phonenumber are random numbers. Names are normal norwegian names. You can also make your own PHP API to test this...

4. Property at 'RESTClient1->BaseURL'=" www.tileblock.com/userdata " (add http:// in front)

5. Property at 'RESTRequest1->Resource'="condbtest.php"

6. Property at 'RESTResponseDataSetAdapter1->ResponseJSON'="RESTResponse1"

7. Property at 'RESTResponseDataSetAdapter1->RootElement'="phonenums"

8. Property at 'RESTResponseDataSetAdapter1->Dataset'="FDMemTable1"

9. Publish data into the components by clicking "Execute..." in Object Inspector when 'RESTRequest1' is focused. You should get following message "Response: 200 - HTTP/1.1 200 OK." If you get "404" message the site might be down or my API might bed disabled, or you have a typo... check spelling. If correct... post me a response message...

10. Addingly:
10.a. with use of template "Blank Application" you get no errormessages.
10.b. with use of template "Header/Footer with Navigation" you get erromessage "Adapter does not have a Response component"

11. Rightclick on "FDMemTable1" and select "Fields Editor".

12. Rightclick in "Field Editor" and select "Add fields".

13. Select the elements you need and click OK.

14. The fields are populated to the "Field Editor"
14.a. with use of template "Blank Application" you get no errormessages
14.b. with use of template "Header/Footer with Navigation" you get erromessage "FDMemTable1: Duplicate field name 'pid'". Click OK.

15. Close "Field Editor"

16. Open LiveBindings Designer: "View->LiveBindings Designer"

17. Connect '*' from FDMemTable1 to StringGrid1
17.a. No error messages
17.b. Repeats error message from pt. 14.b.:"FDMemTable1: Duplicate field name 'pid'"

18. Result.
18.a. StringGrid1 gets populated. You might need to run "Execute..." a second time from 'RESTRequest1'.
18.b. Error stops population of the StringGrid. You have a show stopper...

19. Add a TButton component to your application. Doubleclick it and assign following code "this->RESTRequest1->Execute();".

20. Run and debug your application.
20. a. It works!
20. b. You would never reach here. It failed at pt. 18.b.

Anyone who can tell me the difference here ? Why it works at "simple" templates, and not the ones with "navigation".

Have not tested the "Tabbed" template yet (w/o navigation).

====

Update: Tested it on the "Tabbed" application template: The error does not appear there. The problem seems to appear when the navigation function is present, i.e "Tabbed with Navigation" and "Header/Footer with Navigation".
  • Page:
  • 1
Moderators: April Anne