cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori / SAPUI5 - Traverse 'up' Context to parent

former_member725
Participant
0 Kudos

Hello Everyone,

I am making a simple application which traverses a nested JSON object using a simple SAPUI5 List and ObjectListItem. Moving 'down' the list is pretty simple to do; however I am not finding how to move 'up' the list to the parent of the current context.

Does this ring a bell for anyone?

Tags edited by: Michael Appleby

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor
0 Kudos

Hi Craig

Can you share how your JSON data looks like? Using path, we should be able to 'move up'. If you can share some code on how you 'move down' will be nice so we understand what have done.

Thanks

-D

former_member725
Participant
0 Kudos

Thanks Dennis,

Here is the JSON..

[

    {

        "title": "Folder1",

        "type": "folder",

        "icon":"folder-blank",

        "children": [

            {

                "title": "Sample Document1",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

               

            },

            {

                "title": "Sample Document2",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document3",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

               

            },

            {

                "title": "Sample Document4",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document5",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

  {

          "title": "Folder1a",

          "type": "folder",

          "icon":"folder-blank",

          "children": [

              {

                  "title": "Sample Document1",

                  "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                  "type": "document",

                  "icon": "document"

                

              },

              {

                  "title": "Sample Document2",

                  "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                  "type": "document",

                  "icon": "document"

              },

              {

                  "title": "Sample Document3",

                  "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                  "type": "document",

                  "icon": "document"

                

              },

              {

                  "title": "Sample Document4",

                  "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                  "type": "document",

                  "icon": "document"

              },

              {

                  "title": "Sample Document5",

                  "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                  "type": "document",

                  "icon": "document"

              }

          ]

      } 

        ]

    },

    {

        "title": "Folder2",

        "type": "folder",

        "icon":"folder-blank",

        "children": [

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            },

            {

                "title": "Sample Document",

                "link": "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf",

  "description":"This is the description for the document",

                "type": "document",

                "icon": "document"

            }

        ]

    }

]

As for moving 'down', I bound the JSON model to a List object, so I really didn't have to do anything.

former_member182862
Active Contributor
0 Kudos

Hi Craig

I am not sure if this is what you are looking for?

-D

former_member725
Participant
0 Kudos

Wow.. Thanks a ton !

Answers (0)