cancel
Showing results for 
Search instead for 
Did you mean: 

Navigate to second IconTabFilter using a button in first IconTabFilter

former_member601668
Participant
0 Kudos

Hi,

I have a button inside IconTabFilter,when i click on that button it should navigate to the next IconTabFilter.

can anyone tell me how to do that.

former_member601668
Participant
0 Kudos

I have a button under one plus 6T tab,what i want is when i click on the "Buy Now" button, it should navigate to the customer information.

maheshpalavalli
Active Contributor
0 Kudos

Hi Tarun,

great, a small tip you need to click on comment to reply instead of answering.

you also need to mark my answer as answered 😛

BR,

Mahesh

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

Hi sai tharun,

You can check the UI5 library api reference for this controls, which has all the methods available to solve your issue.

https://ui5.sap.com/#/api/sap.m.IconTabBar/methods/setSelectedKey

Call the above method to set the selected key by passing the second icon tab key value.

BR,
Mahesh

maheshpalavalli
Active Contributor
0 Kudos

Sai Tharun this one

Answers (2)

Answers (2)

former_member601668
Participant
0 Kudos
App.view.xml:

<IconTabBar id="idTopLevelIconTabBar">
<items>
<IconTabFilter text="{i18n>onePlus6TFilter}" key="1">
<Carousel>
<pages>
<Image src="https://spiderimg.amarujala.com/assets/images/2018/07/10/750x506/oneplus-6_1531206415.jpeg" height="600px"/>
<Image src="https://images.indianexpress.com/2018/06/759-25.jpg" height="600px"/>
</pages>
</Carousel>
<Toolbar>
<ToolbarSpacer/>
<Button text="{i18n>showBuyText}" type="Accept" press="onShowBuy"/>
</Toolbar>

<IconTabFilter text="{i18n>layoutCustomerFilter}" select="onShowBuy" selectedKey="2">
<MessageStrip type="Information" showIcon="true" text="All fields are mandatory"/>
</IconTabFilter>

App.controller.js:<br>
onShowBuy: function (oEvent) {
	this.getView().byId("idTopLevelIconTabBar").setSelectedKey("2");
        } 
maheshpalavalli
Active Contributor

Check this sample..

you are getting the button source and calling src.getSelectedKey(sKey) ==> Obviously this will not work right??

You need to get the reference of the IconTabBar and call getSelectedKey.

https://next.plnkr.co/edit/QM7WoaCueCsDjJ27?open=lib%2Fscript.js⪯view

BR,

Mahesh

former_member601668
Participant
0 Kudos

Got it

Thanks mahesh

maheshpalavalli
Active Contributor
0 Kudos

HiSai Tharun,

I mean, you need to mark my answer as answered 😄 not yours as it is comment by you 🙂 Mahesh

maheshpalavalli
Active Contributor
0 Kudos

I think you need to check the old answers not this one.. as I only commented here to your answer.

Comments cannot be marked as answered, only the answers will be marked as answered.. So you need to check my first answer.

Else it might be bug click on "Alert Moderator" and report the issue.

BR,
Mahesh

former_member601668
Participant
0 Kudos

Hi mahesh,

I have tried that but what i want is navigation from one icontabfilter to another,not from one icontab to another.

maheshpalavalli
Active Contributor
0 Kudos

Hi Sai,

I dont understand your query..

If you are having iicontabar then if you want to select one icon tab filter from another you need to call that method I mentioned..

But it might not call the icontabfilter selected event, so you need to put that code in a reusable function and call it along with the setSelectedKey method..

Or am I missing something? Posting code would be helpful.

BR

Mahesh