Using HTMLViewer in DesktopTabPanel API2 shows no webpages

With the program I’m creating, it is possible to show various webpages in a TabPanel.
Works fine with API1.

But after I converted the program to API2 showing webpages in a TabPanel no longer works.
The whole TabPanel is invisible.
This problem is in macOS and in Windows.

<https://xojo.com/issue/68039>

I hope that Xojo will look into this case and solve it asap because this will prevent me moving to API2.

Apparently, there is a bug in the TabPanel with recent Xojo versions. Read the Feedback here:

The title is a bit misleading (IMHO/No offense), the bug seems to be the one you reach.

Looks fine. You might want to try the tester channel.

A workaround might be to make a DesktopContainer to fill the PagePanel page. Put the HTMLViewer on the Container.

I already had this problem some time ago, before the API2 controls.

If you click ‘New Tab’ and then ‘Close Tab’ do you see something?

@TimStreater
The HTMLViewer is already on a container.

@AlbertoD
When I click New tab nothing happens, but when I click close tab all of a sudden the TabPanel (with the webpages) is shown.

In AddNewTab change your code:

//BrowserTabPanel.PanelIndex = page
BrowserTabPanel.SelectedPanelIndex = page

in CloseTab comment this line

//BrowserTabPanel.PanelIndex = BrowserTabPanel.SelectedPanelIndex - 1

at least this works on mac.

Note: you will need to add the Windows specific code for CloseTab (I think)

@AlbertoD
Thank you!
You have found what the problem was.
I used 2 times PanelIndex instead of SelectedPanelIndex
After I had replaced both occurrences of PanelIndex with SelectedPanelIndex, the webpages are shown correctly.

3 Likes

The naming is a bit misleading, PanelIndex could have been named some thing like ParentPanelIndex.