Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Binding Array Length to Label

hi,
using Facebook Graph API i am getting array of likes , and i want to bind number of likes to my button text, how can i do that ?
Image

thanks

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Binding Array Length to Label

Hello,

You should map data[] to grid and name to button text. See link below: http://devcenter.appery.io/documentat...

Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Binding Array Length to Label

the main array is already bound to MobileListItem and i can extract text values to other controls as this image

Image

but i want to Bind number of likes to the btnLike.Text shown in this image
for example if there is 3 items in 2nd data array i want the text of btn "Likes (3)" for example

Image

Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Binding Array Length to Label

so i dont want the looping feature here

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Binding Array Length to Label

In this case you should add JS to your mapping to mobilelistitem_43: http://devcenter.appery.io/documentat...
You can use this code:

codeelement.find("[name=btnLike]").text("Likes(" + value.likes.data.length +")");/code

Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Binding Array Length to Label

i mapped the [likes] object to the grid, then used the above script and it works, thank you

Return to “Issues”