K. C. Lee
Posts: 0
Joined: Fri Oct 11, 2013 7:51 pm

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

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"
]
]
]
]
}

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

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

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

Let us know if you need any additional help.

K. C. Lee
Posts: 0
Joined: Fri Oct 11, 2013 7:51 pm

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

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

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

usually means some index (when mapping is executed).

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

K. C. Lee
Posts: 0
Joined: Fri Oct 11, 2013 7:51 pm

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

The screen shot is posted for your reference.
Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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.

K. C. Lee
Posts: 0
Joined: Fri Oct 11, 2013 7:51 pm

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

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.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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?

K. C. Lee
Posts: 0
Joined: Fri Oct 11, 2013 7:51 pm

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

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.

Return to “Issues”