cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation list only with two levels ??

Former Member
0 Kudos

Dear openui5 developers,

I'm very glad you've provided such a nice control as navigation list and especially navigation list item that aggregates itself.

However, it's a bit strange that you propose to use it only with two levels.

I have created a simple program with JSON model like this:


{

  "OrgUnitSet": [{

  "Id": 1,

  "Name": "Bank 1"

  }, {

  "Id": 2,

  "Name": "Bank 2"

  }, {

  "Id": 3,

  "Name": "Bank 3",

  "ChildrenDirect": [{

  "Id": 5,

  "Name": "Bank 5",

  "ChildrenDirect": [{

  "Id": 6,

  "Name": "Bank 6"

  }, {

  "Id": 7,

  "Name": "Bank 7"

  }]

  }]

  }, {

  "Id": 4,

  "Name": "Bank 4"

  }]

}

and a simple view like this:


<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.tnt">

  <NavigationList items="{/OrgUnitSet}" width="30%">

  <NavigationListItem text="{Name}" items="{ChildrenDirect}" expanded="false">

  <NavigationListItem text="{Name}" items="{ChildrenDirect}" expanded="false">

  <NavigationListItem text="{Name}" expanded="false"></NavigationListItem>

  </NavigationListItem>

  </NavigationListItem>

  </NavigationList>

</mvc:View>

as I expect I should see the three-level tree, however what I actually have is:

However I expected to see the screen like this:

What's interesting - I managed to get these screens just by extending the component without any single line of redefinition:


sap.ui.define([

  "sap/tnt/NavigationListItem"

  ],

  function(NavigationListItem) {

  "use strict";

  return NavigationListItem.extend("sbt.mob.control.NavigationListItem", {

  });

  }

);

Could you please provide this feature in the original control?

Will be glad to get some feedback.

Thanks!

P.S: I have prepared a special project to demonstrate both options:

theplenkov / sapui5-issues &amp;mdash; Bitbucket

Accepted Solutions (0)

Answers (3)

Answers (3)

karthikarjun
Active Contributor
0 Kudos

Hi Petr- I am projecting my points here.

1. you should extend the tnt control according to your need.

2. i think, sap has integrated one level of hierarchy of tnt navigation control. The next level it should error in id. so i conclude here as SAP has a one level of hierarchy.

Correct me if I wrong!!!

Regards,

Karthik A

roland_bouman
Contributor
0 Kudos

"you should extend the tnt control according to your need." < Yes, that is the easy part. My question is, once I have that, how do I refer to my extension in a XML View? How does sap know to call my code for a particular xml tag?

roland_bouman
Contributor
0 Kudos

> "The next level it should error in id. so i conclude here as SAP has a one level of hierarchy."

Why? THe API Docs don't say anything that it shouldn't be possible.
I did see that this control is supposed to replace the recently deprecated sap.m.Tree control, but if that is the case then this solution sucks since it clearly does not offer the same functionality as the tree.

(The other candidate, TableTree has other issues so it seems there is actually no equivalent control to replace the sap.m.Tree?)

roland_bouman
Contributor
0 Kudos

How do you reference your extension of the NavigationListItem in the XML Views?

roland_bouman
Contributor
0 Kudos

I am experiencing the same issue.