Tab viewPath not rendering selected view

following the manual on Tabs:

If the element is changed to an object data type, then the text on the tab can be set by adding a text value member to the object and providing a string, as seen on element 0 below. Alternatively, viewPath (value data type) and viewParams (object data type) can be added to the element, which allows you to render a view inside the tab as well as pass parameters to it.

i created a tab and changed the element to and object and populated it. but it doesn't render. :frowning: what am i missing?

i also get an odd error in the top right corner:

tab[0] object found, String expected
tab[1] object found, String expected

EDIT: here's an unobstructed image of the props:
Screenshot 2023-07-19 150447

EDIT 2: does this only control the tab itself!?

EDIT3: it only controls the tab itself. not it's contents. the manual could use better wording...

Hi @ian.sebryk

I tried what you have said and you are right, the tabs are not showing the embedded view. So I tried another approach. I converted the tabs array indexes into strings

image

The inside each tab I added an embedded view component.

And now my embedded views are showing inside the tab container.

I hope this trick helps, however it needs to be seen why the embedded views are not showing directly inside the tab container as per the documentation.

Are you trying to render an embeded view as the tab? If not, then what @Usman_Ashraf has shown is the correct method.

If you are, then I am not sure why it isn't rendering. Perhaps @cmallonee has some insight?

Might want to provide Ignition Version.

EDIT:

I will say, that bit of the manual can be a bit misleading and it took me a few times before I was clear. The real give away for what they are saying can be accomplished is the provided image.


The highlighted portion of the image is the tabs of the tab control.

2 Likes

i was trying to find a workaround for the fact that you can't change the display of a particular tab. and in setting the tab's indicies to object, i could add the disabled property. what i was expecting was the viewPath property to populate the tab contents, not the tab itself. and, oddly enough, the errors that display, expecting strings, doesn't hamper the functioning of the tab-as-object. :person_shrugging:

so, thank you for helping me clear up the functional differences there. :+1:

1 Like

Ahaaaan, this makes sense. Thank you

yeah. tricky wording in the manual, eh? oh well. at least we have a pretty decent manual. some wares i've worked with have manuals written by hardcore engineers for hardcore engineers. nightmare. :scream:

2 Likes