Page 1 of 2

Nested array mapping (e.g., VCARD) to GUI list.

Posted: Fri Oct 11, 2013 7:51 pm
by K. C. Lee

Hi,
Need to get VCARD response. Get address and telephone fields and display to a GUI (List).

(1) Any suggestion on how to MAP the response (VCARD) to an item or collapsible List? I am not clear about the syntax definition and how to map array.
(2) Where and how to inserting an javascript to parse the VCARD response, If auto-mapping cannot be done.

Thanks.

The automatically generated return format by Appery.io GUI for VCARD is as follows:

VCARD
VCARD
DownArrow

DownArrow
DownArrow


The following are the VCARD (W3C) response from a service end point.

{
"JCARD": [
"vcardstream",
[
"vcard",
[
[
"version",
{},
"text",
"4.0"
],
[
"n",
{},
"text",
[
"Gump",
"Forrest",
"",
"",
""
]
],
[
"fn",
{},
"text",
"Forrest Gump"
],
[
"org",
{},
"text",
"Bubba Gump Shrimp Co"
],
[
"title",
{},
"text",
"Shrimp Man"
],
[
"photo",
{
"mediatype": "image/gif"
},
"uri",
"http://www.example.com/dir_photos/my_..."
],
[
"tel",
{
"type": [
"work",
"voice"
]
},
"uri",
"tel:+1-111-555-1212"
],
[
"tel",
{
"type": [
"home",
"voice"
]
},
"uri",
"tel:+1-404-555-1212"
],
[
"adr",
{
"label": "100 Waters Edge\nBaytown, LA 30314\nUnited States of America",
"type": "work"
},
"text",
[
"",
"",
"100 Waters Edge",
"Baytown",
"LA",
"30314",
"United States of America"
]
],
[
"adr",
{
"label": "42 Plantation St.\nBaytown, LA 30314\nUnited States of America",
"type": "home"
},
"text",
[
"",
"",
"42 Plantation St.",
"Baytown",
"LA",
"30314",
"United States of America"
]
],
[
"email",
{},
"text",
"a href="mailto:forrestgump@example.com" rel="nofollow"forrestgump@example.com/a"
],
[
"rev",
{},
"timestamp",
"2008-04-24T19:52:43Z"
]
]
]
]
}


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Fri Oct 11, 2013 8:23 pm
by maxkatz

Mapping, including array mapping is covered here: http://docs.appery.io/documentation/u....

Let us know if you need any additional help.


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Sat Oct 12, 2013 12:37 am
by K. C. Lee

Hi,

Thank for the quick feedback.
I was able to use the documented method to map simple arrays. It does not cover the definition of nested arrays with no key:value pairs as identities.
I do not know how Appery.io maps the array. What is the meaning of and indentations with "down arrows" symbol and empty fields.

Thanks.

KC


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Sat Oct 12, 2013 4:04 am
by maxkatz

usually means some index (when mapping is executed).

Can you post a screen shot of service response and the mapping that you got?


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Tue Oct 15, 2013 2:06 pm
by K. C. Lee

Nested array mapping (e.g., VCARD) to GUI list.

Posted: Tue Oct 15, 2013 2:24 pm
by K. C. Lee

The screen shot is posted for your reference.
Thanks.


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Tue Oct 15, 2013 8:43 pm
by Maryna Brodina

Hello! You have quite complicated service response. There're two ways:
1) Add elements/entries using JS on service success
2) Create Generic service and using JS create response you'll be able to map
In case of such response you have to use JS.


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Wed Oct 16, 2013 8:26 pm
by K. C. Lee

Hi,

I will try these steps later.

I try to use
Appery('mobilelistitem_customerList').closest("li").hide();

The listed items cannot be closed.

I also try to use set property visible to false. Also no effect on the displayed items.

Any suggestions?

Thanks.


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Wed Oct 16, 2013 8:47 pm
by Maryna Brodina

Hello! Could you clarify where do you use this code? What do you want to receive and what you get? What is your specific question?


Nested array mapping (e.g., VCARD) to GUI list.

Posted: Wed Oct 16, 2013 9:07 pm
by K. C. Lee

Click event - javascript function field{

Appery('mobilelistitem_customerList').closest("li").hide();

I have a list of 5 items populated.
I want to clear it when other list are displayed.

Thanks.