Reference a specific tab

If I open new tabs based on double clicking a grid row. Is there a suggested way that I can check to see if a tab has already been opened for that row (based on a unique key), and if so show the already existing tab? This will eliminate opening duplicate tabs.

Thanks in advance.

Hi code08,

JavaScript is a general purpose programming language, so you can do this whatever way you wish. You could set a property on the record object indicating a tab had already been show for it, or you could search through the tabs you have already added each time a new doubleClick occurs, via iterating down tabSet.tabs, or any other approach you like.

I guess what I’m asking is, could you set an ID on the newly opened tab say “tab123” and then later in script check for the existence of that tab using the ID?

Yes, that’s one valid way to do it.

What’s the syntax in SmartClient to find a widget by ID. For example with dojo there is dojo.widget.byId(“tab1123”), what would the equivalent be in SmartClient?

If you assign an ID to a widget it becomes a JavaScript global. So window[ID] works.

Works like a charm, thanks!