Updating WebPagePanel Panel Captions

I have searched and I see very limited documentation about this. I want to change the panel captions from Page 0 - Page 1 - Page 2 - etc To something more descriptive. I have found one article that states use a method and assign the caption with the pagepanel.value call. However, .Value is not in my list of options.

Is anyone updating these captions and can share how they are doing it since it still isnt configurable in the IDE?

you should be able to do it using some executejavascript.
@AlbertoD or @Anthony_G_Cyphers are the web javascript guru here…
and @Ricardo_Cruz of course…

I’m assuming you mean the tab captions in a WebTabPanel as WebPagePanels have no visible captions in the browser. If not, sorry for the noise.

To change the tab captions at runtime, add this method to a module and call from the Shown event:

Public Sub TextAt(extends t as WebTabPanel, index as Integer, assigns caption as String)
  if index < 0 or index > t.PanelCount then Return
  
  '// Use a JSONItem to escape and clean the string
  var j as new JSONItem
  j.Value( "caption" ) = caption
  
  var exec() as String
  exec.Add( "var j = " + j.ToString + ";" )
  exec.Add( "$('#" + t.ControlID + "_tab_" + index.ToString + "').html(j.caption);" )
  t.ExecuteJavaScript( String.FromArray( exec, "" ) )
End Sub

Call as:

TabPanel1.TextAt( 0 ) = "Test"
5 Likes

Are you talking about these captions?
image

There is no way to change them using the IDE (as you already said) and those captions are not visible in the browser (as Anthony said).

If Xojo is going to allow changing the name, how we will match Page 0 with the control showing 0 (or 1, 2, etc.) in the IDE?
image

Edit: Thank you Anthony, it looks like Xojo is missing a way to change the Tabs caption at run time.