Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

List content display issue on return of database service

I am mapping response from Appery database service to Appery list component (in the Appery design view I retain only one item called ListItem with default text, and the list is called List). On success I execute the JS here:

Image

The service is invoked on page show and on success of service I invoke a listview refresh.

The issue is that the when the page shows up for the first time the list-items don’t show the text from service output I expect but the default text as in Appery design. However when I press the back button and again come to this page the behavior is exactly as I expect. The behavior is perplexing because the display was working fine for me earlier but is showing this anomalous behavior now.

What might be going wrong here?

Thank you.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

List content display issue on return of database service

Hello,

We'll check solution and someone will get back to you with update as soon as possible.

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

List content display issue on return of database service

Thanks very much. Will look forward to your feedback.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

List content display issue on return of database service

Hi Cody,

You are using list component as not specified in our documentation. Thus you have unexpected results.

Please follow this tutorial: http://docs.appery.io/tutorials/build... -in part of "Building the UI"

This tutorial describes how you have to use list properly.

But if you want manually make html (as not recommended for this simplest logic) - please use HTML component and place inside this component your own list (not the Appery.io component).

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

List content display issue on return of database service

Hi Illya,

I am aware of the tutorial and the implementation that you pointed out on your website. However the mapping I am trying to fix is bit more involved and can't be fixed using the steps in the tutorial. I am attaching a screenshot of the mapping I currently have. The service response is retuned by a query service and there is exactly one object that is returned. username is the screenshot is an array and can have 1 or more elements. Image

When I run the test with above implementation (without any JS) I get the number of list-items on the UI as number of elements in the array username. However the text in username is not displayed in the listItems.

Will appreciate your help in resolving this outstanding issue.

Thanks.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

List content display issue on return of database service

Hi Cody,

Please post the test tab results example.

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

List content display issue on return of database service

Hi Illya,

I am aware of the tutorial and the implementation that you pointed out on your website. However the mapping I am trying to fix is bit more involved and I believe can't be fixed using the steps in the tutorial. I am attaching a screenshot of the mapping I currently have. The response is retuned by a query service and there is exactly one object returned. username in the screenshot is an array and can have multiple elements. Image

When I run the test with above implementation (without any JS) I get the number of list-items as number of elements in the array username. However the text in username is not displayed.

Will appreciate your help in resolving this issue. In case this helps I have shared my project with support@appery (this is the only project linked to my account). The relevant page is called AddFriendPage

Thank you.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

List content display issue on return of database service

Hi Cody.

You have to map username to pendingRequestsListItem.text.

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

List content display issue on return of database service

Hi Alena,

I had actually tried that already, alongside other mapping combinations from the response.

Mapping username leads to display of just the first element in the array on UI, but rest of the array elements do not get mapped or appear on UI as a listitems. When I add console.log(value) in the associated JS, the array shows up on console properly.

Thanks for your help on the matter.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

List content display issue on return of database service

Cody,

1 bind username to pendingRequestsListItem.text

2 delete JS handler codeconsole.log(value)/code which does not return a value. (return undefined).

Please take a look at this screen shot

Image

After above manipulations the result is:
Image

Return to “Issues”