Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Repeating DIVs

$
0
0

Hello colleagues,

could you please advise?

 

The problem:

I'm developing with MVC concept (as best practice).

My Html is like this:

...scripts..


I have implemented this(SAPUI5 Explored)  controller as switcher between tabs (IconTabBar with 4 switching contents by click).

<mvc:View  xmlns:l="sap.ui.layout"  xmlns:mvc="sap.ui.core.mvc"  controller="nalog-ui5.tabs"  xmlns="sap.m">  <IconTabBar    class="iconTabBarPaddingTop"    id="idIconTabBarMulti"    expanded="{device>/isNoPhone}">    <items>      <IconTabFilter        icon="sap-icon://hint"        text= "Обзор">        <mvc:JSView id="content" viewName="nalog-ui5.Overview"></mvc:JSView>      </IconTabFilter>      <IconTabFilter        icon="sap-icon://upload"        text="Загрузить документ">        <mvc:JSView viewName="nalog-ui5.Upload"></mvc:JSView>      </IconTabFilter>      <IconTabFilter        icon="sap-icon://group"        text="Контрагенты">        <mvc:JSView viewName="nalog-ui5.Contragents"></mvc:JSView>      </IconTabFilter>      <IconTabFilter        icon="sap-icon://expense-report"        text="Счета-фактуры" >        <mvc:JSView viewName="nalog-ui5.Facturi"></mvc:JSView>      </IconTabFilter>    </items>  </IconTabBar></mvc:View>


My switching tabs are in the "header" div.

 

So, all content goes to "header" as well.

Each tab calls the separate view.

Meanwhile, I want to ".placeAt" Tables into "content". It returns successfuly, but when I switch to another view, I obviously get the content of my "content" on another view.

How can I kill content from that div when I click on another tab?

 

I found the onExit: event, but it is called only on Controller destroy. but I don't destroy it.

I also found onBeforeRendering method and put

onBeforeRendering: function() {  //$('#Fdet').empty();  $('#content').empty();  $('#Table2').remove();  },

But it is bad way and my DIV is back in double after it is created again (on table row click).

 

So, my question is:

how is it better to embed DIVs into the view, so it is not created on other screens?

Thank you


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>