Var n As Integer = 0
For Each cntrl As WebUIControl In Self.Controls
If cntrl IsA MyTextField Then
n = n + 1
MyTextField(cntrl).Caption = "Init "+n.ToString
End
Next
Looks like that someone at xojo cant understand why users want Control Arrays, so dont hold your breath on this. Web2 is still feature incomplete, Im still on web1 for now.
A few questions
@ Rick A - When wanting to read the value of a WebPopupMenu, and there are more than what you want to read at this time, how to identify them?
@ Ivan Tellez thank you also for responding. I suppose we can hope!
when playing with webpopupmenus (and other menus) you always have the rowtag property where you can store a unique id to identify the line that was choosen.
Maybe it was my confusion, but the “RowTag” only identifies the line the was chosen. In this case, it needs to ID the WebPopupMenu object itself. I saw no way to do that - ie set a property to each WebPopupMenu - not it’s contents. Similar to having an array of WebPopupMenus like in Web1
You could do something like this, but you should probably revisit your design if this achieves what you want:
// The items in the array are WebPopupMenus on the WebPage
var aroMenus() as WebPopupMenu = Array(WebPopupMenu1, WebPopupMenu2, WebPopupMenu3)
for each oMenu as WebPopupMenu in aroMenus
for i as Integer = 1 to 11
oMenu.AddRow(i.ToString + ":00")
oMenu.AddRow(i.ToString + ":15")
oMenu.AddRow(i.ToString + ":30")
oMenu.AddRow(i.ToString + ":45")
next i
next oMenu
A TimeMenu subclass would be recommended, or finding some better way to enter times. The way Indeed has you select availability is an absolute pain.
Rick gave you a pretty good answer. Make a subclass and use it only for the controls you want in the controlarray. If you want a different control array, create another subclass. Then you can loop through all the controls and identify which ones are in the control array by examing their control type.