cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
stgiesbrecht
Level: Powered On

Gallery of tab headings

I have a gallery that contains a single button that I am using to create dynamic tabs across the top of my screen as follows:

galleryTab.png

 

 

In this example, Items are populated as ["Details"," Contracts"," Attachments","Amendments", Approvals"]

The OnSelect of the button has Select(Parent);UpdateContext({currentTab: ThisItem.Value}) which I then use to hide or show the appropriate information.

The issue that I am having is that when I navigate back to the home screen and then come back to this screen, the tab for "Details" is not highlighting as white even though that is the value being passed in as a parameter on the navigate command. You can see that above that "Attachments" tab is white, even though currentTab = "Details" as can be seen from the label just below the tabs. The tab that is white is whatever was the last clicked tab prior to navigating away from this screen.

1 ACCEPTED SOLUTION

Accepted Solutions
KroonOfficeSol
Level 10

Re: Gallery of tab headings

Oke, wrong answer sorry.

 

What you should do is to ClearCollect() your tabs FirstScreen.OnStart. Formula:

 

ClearCollect(Tabs, {Value:"Details"},{Value:"Contracts"},{Value:"Attachments"},{Value:"Amendments"},{Value:"Approvals"})

Then use this collection in your gallery.Items.

 

 

Then on your button.OnSelect you do:

UpdateContext({TabSelected:ThisItem.Value})


Then on the Gallery.Default goes this:

 

 

LookUp(Tabs, Value = TabSelected)

I tried it and it works like a charm.

 

Hope this helps.

 

Paul

6 REPLIES 6
KroonOfficeSol
Level 10

Re: Gallery of tab headings

You have to set the gallery.defaultselecteditems to the currentTab variable.
stgiesbrecht
Level: Powered On

Re: Gallery of tab headings

Not sure I understand where this goes. If I try to set Default property for the gallery to the variable, I get a "Invalid formula. Expected a value compatible with 'Items'." message.

galleryProperties.png

KroonOfficeSol
Level 10

Re: Gallery of tab headings

Wrong attribute. Pick .DefaulSelectedItems
stgiesbrecht
Level: Powered On

Re: Gallery of tab headings

I am not seeing that as one of the properties for the gallery

KroonOfficeSol
Level 10

Re: Gallery of tab headings

Oke, wrong answer sorry.

 

What you should do is to ClearCollect() your tabs FirstScreen.OnStart. Formula:

 

ClearCollect(Tabs, {Value:"Details"},{Value:"Contracts"},{Value:"Attachments"},{Value:"Amendments"},{Value:"Approvals"})

Then use this collection in your gallery.Items.

 

 

Then on your button.OnSelect you do:

UpdateContext({TabSelected:ThisItem.Value})


Then on the Gallery.Default goes this:

 

 

LookUp(Tabs, Value = TabSelected)

I tried it and it works like a charm.

 

Hope this helps.

 

Paul

stgiesbrecht
Level: Powered On

Re: Gallery of tab headings

@KroonOfficeSol, thank you very much for this. Your solutions works great and does what I need.