Skip to Content
Former Member
Jun 23, 2014 at 10:53 AM

Removing Panel Completely from layout


Hi All,

I have an functionality to create nested panel one inside the other, when I click on any of the panel it should remove the panel with their children in it. I have create the panel as given below and added an click event using the panel button and tried to remove the panel from the parent panel. I have used the removeContent(0), removeAllContent(0) for removing the current panel where the click event is fired. this removes the content alone not the panel, when I try to add an panel in the layout (nested), The panel I removed earlier is loading back with the newly created panel. Please help me to add an functionality to remove the panel section on click of the button on the panel header.

my ui logic is as below.

Panel 1--------

Panel 2-----------

Panel 3-------------

Panel 4--------------

When I remove panel 3 --- panel 3 & panel 4 should be removed. when I remove the panel 1 all the panels rendered below should be removed. the below is the code I have used to remove the panel

sap.ui.getCore().byId("CurrentPanelId read from click event").removeAllContent(0);

Thanks in Advance.