musaarda / SideNavigationExtend

Extend SAPUI5 SideNavigation Control
0 stars 1 forks source link

Uncaught TypeError: rm.write is not a function with SAPUI5 1.71.0 #2

Open gregorwolf opened 5 years ago

gregorwolf commented 5 years ago

Hi @musaarda ,

thank you for this great extension. Unfortunately yesterday the default SAPUI5 version was updated to 1.71.0 (even if it’s not documented in the release notes https://help.sap.com/doc/43b304f99a8145809c78f292bfc0bc58/Cloud/en-US/98bf747111574187a7c76f8ced51cfeb.html?sel1=SAPUI5). And now I get the following error:

XNavigationListItem.js?eval:65 Uncaught TypeError: rm.write is not a function at f.renderFirstLevelNavItem (XNavigationListItem.js?eval:65)

The RenderManager still has the write method: https://ui5.sap.com/1.71.2/#/api/sap.ui.core.RenderManager/methods/write and I've checked also the source code of the RenderManager where the method appears. Maybe you have an idea.

Best regards Gregor

Marsmanni commented 5 years ago

Hi Musa, hi Gregor,

the renderGroupItem and the renderFirstLevelNavItem methods changed in the sources, instead of the old api, the new is used, so it is rm.openStart("button", control) instead of rm.write("<button") and so on: https://github.com/SAP/openui5/blob/master/src/sap.tnt/src/sap/tnt/NavigationListItem.js.

I don't know why the write methods are not available any more, seems the "switch" to apiVersion: 2 gives this effect.

A quick and working solution was to replace the code of renderFirstLevelNavItem and renderGroupItem in XNavigationListItem of Musa with the up-to-date code of the ui5 github (and add the indent function as var indentValue = this.getLevel() * 0.75; rm.style("padding-left", indentValue + "rem");

See also https://de.slideshare.net/aborjinik/rendering-evolution-in-ui5

Best regards, Christof

gregorwolf commented 5 years ago

Any plans to send @xmarda a pull request with your corrections?

Neasit commented 3 years ago

Hi,

I have done adaptation for 1.71 and use it in my project - there are too much changes, so I done just fork. https://github.com/Neasit/SideNavigationExtend

Best regards, Neasit