WebUIControls in WebPage missing?

I you have a webPagePanel, and WebUIcontrols inside on a WebPage,
is it normal that the Controls() array only contains top level controls ?

how do you loop to get a reference of a webuicontrol inside a webpage(or tab) panel ?


ps: Xojo 2021r21 I did not check with last beta.

here is a webpage with some controls. and one control inside a tabpanel.
how can get the “not visible” textfield control ?

in the shown event of the webpage :

For Each c As WebUIControl In Me.Controls
  TextArea1.Text = TextArea1.Text + c.Name + EndOfLine
Next c
TextArea1.Text=TextArea1.Text+"lastcontrolindex of tabpanel : "+Str(TabPanel1.LastControlIndex)

just found this : feedback://showreport?report_id=62487

my test project

You should add it to the ticket.


1 Like

same problem with last beta …

I originally thought I could use pagepanel.lastcontrolindex but it always returns -1…
even pagepanel.controlat(0) returns outofbounds exception, but there is one control there !

I understand now that “lastcontrolindex” is for the last ADDED control with the AddControl method… as I did not add one but only dragged with the IDE the value is -1…
so what is the replacement for ControlsCount ? so that we can get the controls dynamically in a webpage. very important to make abstract methods for database front end for example.

@Greg_O_Lone any solution or workaround for this ?

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.