Page 1 of 1

load more list-controls data at once

Posted: Thu Sep 12, 2013 5:25 pm
by Adrian Patrascu

I have a service that loads 3 tables (REST JSON service return data / everything OK on test ), after the controls are mapped to the array data the page do not work (two labels and two radiobuttons-list). If I get the tables one by one (each on separate services) it works, but it takes longer.

Is there a possibility to make it working in first scenario ?

I used only the visual designer ...


load more list-controls data at once

Posted: Thu Sep 12, 2013 5:31 pm
by Adrian Patrascu

load more list-controls data at once

Posted: Thu Sep 12, 2013 6:26 pm
by Kateryna Grynko

Hi Adrian,

Could you please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?


load more list-controls data at once

Posted: Thu Sep 12, 2013 7:38 pm
by Adrian Patrascu

Done,
Page is "add_call_product" - popup
The service that do not work is set to be used now, working start service is "call_product" on this page data.
Login for this is "Administrator" password "]"


load more list-controls data at once

Posted: Thu Sep 12, 2013 7:40 pm
by Kateryna Grynko

Adrian,

Thank you, we'll take a look.


load more list-controls data at once

Posted: Fri Sep 13, 2013 12:39 am
by Illya Stepanov

Hello -

It seems that you are managing service with return data.

Let's change the format of the returned data.

You return an object with the data element that contains an array of other objects. In this case, in the mapping you do not mapped data anywhere. That is, for mapping mechanism, you do not create a bypass function of the array, but in the same time you are describing mapping attached to the array of the elements.

From the viewpoint of mapping such structure is not acceptable.

Programmatically there is no good way to solve such situation. Perhaps we should think about validation of such situations, but this is a very difficult task.

The solution lies in the power of your service: make sure that your service would return the data as an object, not an array. As an object with three fields. So it will be more logical and mapping can handle such a structure.


load more list-controls data at once

Posted: Fri Sep 13, 2013 5:41 am
by Adrian Patrascu

Hi,

I'm new here, the returned data is standard JSON data array, can you describe what I should return in cases like this please ?
I can modify the server services as I'll need in this case.

The mapping model I use here It works if I load only one data array into response and populate one "list" object at a time.

The sequential loading it takes long, there are situation's where I need to load 4 "searchbox/other lists" or more. Loading only one service response even bigger is faster.

A sample of JS that can map an array to a "list like" control may help also.

Thank you,


load more list-controls data at once

Posted: Fri Sep 13, 2013 6:06 am
by Adrian Patrascu

load more list-controls data at once

Posted: Fri Sep 13, 2013 10:01 am
by Adrian Patrascu

Hi,

Solved, I did change the response format to an object with arrays from your instructions and works.

Thank you,

Adrian


load more list-controls data at once

Posted: Fri Sep 13, 2013 10:17 am
by Maryna Brodina

Hi, glad it's working! Thank you for update!