on 10-27-2015 7:55 AM
Hi all,
I have a 5 tiles in a view.In the Init method of the view i am checking a certain condition and want to delete the respective tile.
I am using the following code in init to delete
var main = sap.ui.getCore().byId("idUI_tilecontainer"); //Getting the container reference
var tile = sap.ui.getCore().byId("idUI_tile2"); //Getting the tile reference
main.deleteTile(tile);
I am getting the following error in the console and the tile is not getting deleted.The error is referring to the standard controller TileContainer.js
Hi Thivi,
Will this help? JS Bin - Collaborative JavaScript Debugging
Click Edit Button ( check this in Footer )
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vijay:Thanks the code helps to delete the tile after its been displayed by manually clicking delete.But i want to delete before the tile is even displayed in init.
@Vladimirs thanks the code is just a dummy code .
@ all : I just checked that during the first time load of the application in init the deletetile method is nor working and the tile container aggregation still holds 2 tiles.But if i navigate to different screen and then come back to this dashboard the init method is hit again and this deletetile works and tile container aggregation holds 1 tile but it is not reflected in the UI screen.The ui screen still shows 2 tile..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Following is my code
View
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:layout="sap.ui.layout"
controllerName="app.UI_DASHBOARD" xmlns:html="http://www.w3.org/1999/xhtml">
<Shell id="shell_dash">
<Page title="dash" showHeader="true" enableScrolling="false">
<headerContent>
<Button text="{i18n>HeaderBarHelp}" press="Handlehelp"></Button>
</headerContent>
<content>
<TileContainer id="maincontainer">
<StandardTile
id="tile1"
icon="sap-icon://shipping-status"
type="None"
title="tile1
infoState="None"
press="Onpost"/>
<StandardTile
id="tile2"
icon="sap-icon://shipping-status"
type="None"
title="tile2
infoState="None"
press="Onpost2"/>
</TileContainer>
</content>
<footer>
<Toolbar >
<content >
<layout:HorizontalLayout >
<FlexBox
alignItems="End"
justifyContent="End">
<items>
<Image src="images/slogo.png" height="40px">
</Image>
</items>
</FlexBox>
</layout:HorizontalLayout>
</content>
</Toolbar>
</footer>
</Page>
</Shell>
</core:View>
Controller
onInit: function() {
var main = sap.ui.getCore().byId("idUI_tilecontainer"); //Getting the container reference
var tile = sap.ui.getCore().byId("idUI_tile2"); //Getting the tile reference
main.deleteTile(tile);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this code. its use full
Please find working example here - JS Bin - Collaborative JavaScript Debugging (press button Delete Tile2)
Hi Thivi,
IDs are different in view and controller and title of StandardTile quotes not closed.
Made those changes in your code and deleteTile is working fine: JS Bin - Collaborative JavaScript Debugging
Regards,
Sai Vellanki.
I see it is working fine - Tile Container
If possible, can you share the code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it should work... see screen recording below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.