Page 1 of 2

How to get Collapsible List Label Text after populated by database list service

Posted: Sat Nov 02, 2013 7:14 am
by m z

I have two labels located in a collapsible list header that are populated from a list service. The information is mapped correctly and is displayed properly after the list service completes. However, when I try to use the "expand" event to return the label text, I get the default label values set before the list service runs.

When I try the same code with a "static" collapsible list (not populated by a database service), I can easily get the label text.


How to get Collapsible List Label Text after populated by database list service

Posted: Sat Nov 02, 2013 7:30 am
by Igor

Hello,

Could you show us you code?


How to get Collapsible List Label Text after populated by database list service

Posted: Sat Nov 02, 2013 5:19 pm
by m z

it's very straight forward. I just have an alert in java script.

This is in the dynamic collapsible expand event:
alert(Appery('labelModel').text());
alert(Appery('labelId').text());

This is in the static collapsible expand event:
alert(Appery('labelTest').text());

Here are some screen shots of the result:

Image Image


How to get Collapsible List Label Text after populated by database list service

Posted: Sun Nov 03, 2013 2:01 am
by Igor

If you want to get all labels text, you can map the same service response parameters to the page elements and to the localStorage variable. After that you can get this values from local storage.


How to get Collapsible List Label Text after populated by database list service

Posted: Sun Nov 03, 2013 3:04 am
by m z

OK, I'll try this. But why is the dynamic control not working as expected? Is it a bug? I should be able to get the label text when the expand event is triggered.


How to get Collapsible List Label Text after populated by database list service

Posted: Sun Nov 03, 2013 3:27 am
by Igor

No. it isn't a bug. Dynamic control not working because you are trying to get value using static component name. For dynamic components there is some index at the end of the component name. You can try to debug your app and see the dynamic component names . http://docs.appery.io/documentation/d...


How to get Collapsible List Label Text after populated by database list service

Posted: Sun Nov 03, 2013 5:06 am
by m z

Thanks for the clarification. This is from the debugger.

Back-up VOC Carbon System

How would I read back "Back-up VOC Carbon System" within Appery using Javascript? This is in array value 2 of the list.


How to get Collapsible List Label Text after populated by database list service

Posted: Sun Nov 03, 2013 5:07 am
by m z

"Back-up VOC Carbon System"


How to get Collapsible List Label Text after populated by database list service

Posted: Sun Nov 03, 2013 5:09 am
by m z

Let me try with screen capture

Image


How to get Collapsible List Label Text after populated by database list service

Posted: Sun Nov 03, 2013 5:31 am
by Igor

Could you post public link to your app?