Page 1 of 2
List content display issue on return of database service
Posted: Fri Mar 07, 2014 11:23 pm
by Cody Blue
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:
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.
List content display issue on return of database service
Posted: Sat Mar 08, 2014 3:18 am
by Igor
Hello,
We'll check solution and someone will get back to you with update as soon as possible.
List content display issue on return of database service
Posted: Sat Mar 08, 2014 5:28 pm
by Cody Blue
Thanks very much. Will look forward to your feedback.
List content display issue on return of database service
Posted: Sun Mar 09, 2014 11:13 pm
by Illya Stepanov
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).
List content display issue on return of database service
Posted: Mon Mar 10, 2014 7:57 pm
by Cody Blue
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.
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.
List content display issue on return of database service
Posted: Mon Mar 10, 2014 8:01 pm
by Illya Stepanov
Hi Cody,
Please post the test tab results example.
List content display issue on return of database service
Posted: Mon Mar 10, 2014 8:02 pm
by Cody Blue
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.
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.
List content display issue on return of database service
Posted: Mon Mar 10, 2014 10:09 pm
by Alena Prykhodko
Hi Cody.
You have to map username to pendingRequestsListItem.text.
List content display issue on return of database service
Posted: Mon Mar 10, 2014 10:41 pm
by Cody Blue
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.
List content display issue on return of database service
Posted: Mon Mar 10, 2014 11:30 pm
by Alena Prykhodko
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
After above manipulations the result is: