WebTextField array in WebContainer issue

So, I figured that it is not possible to edit the content of a WebListBox. Or perhaps there is a way? As a workaround, I decided to make my own with a series of WebTextField arrays within a WebContainer.

The webcontainer alreary has two rows of each of the WebTextFields. Now, my issue: My webcontainer has a method called “AddRow”, to, well add a row… As of now, I am only trying to add new controls for the first column. Once I get this working, I will proceed to make it general.

My method has this code:

[i]dim C as WebTextField
dim S as WebStyle
dim I as integer = 0

While pgC_Menu.wcMenuConfig1.txtClient(i)<>Nil ’ Get current array member count
msgbox (cstr(i)) ’ is this method working? show how many in the array. remove from final method…

if I / 2 <> I\2 then
S = StyleGridImpairCentr ’ style for odd lines
S = StyleGridPairCentr ’ style for even lines
end if

C = new pgC_Menu.wcMenuConfig1.txtClient ’ add a new member to control array
'c.index = i
C.top = txtClient(i-1).top + txtClient(i-1).height ’ align control with grid
C.Left =txtClient(i-1).Left
C.style = S
C.visible = True ’ should not be necessary
C.enabled = true ’ should not be necessary[/i]

It does not add a new control to the array. I cannot find what I am doing wrong. Would someone please take a look and help? The behavior is the same whether I am starting from RealStudio 2012 R2 or Xojo. My browser is Chrome, on a Windows 7 64bit platform.



Sure there is. Cell, AddRow, RemoveRow…

I do these a lot with table-display interfaces.



Thank you for you answer, butI think I did not make my point clearly. I know that I can add or remove rows in a weblistbox, that is not the point. The point is to make rows that I add editable. As in the user can change the content of any given cell.


Got it. So before trying to roll a complete new WebListBox, I’d dive into the DOM and see if I could figure out a way to position a WebTextField over a particular cell via JavaScript and disable scroll bars while it’s in use. Have you looked into doing that? Obviously not guaranteed to remain compatible with what Xojo does in the future, but it implements a feature you need now.

Thanks Brad;

It is an idea that would work. I thought of that too. An other method I was thinking of is to build an array of text fields. The array remains fixed. I load the data in an internal table and scroll the data up or down the fixed array. The data moves up and down, but the screen structure does not change. The key here is to keep the indices clean so each control “knows” what line of the table it holds at any given time in case there is an edit.

Now, do you have any idea why I cannot add members to my control array dynamically, such as in the code I posted? I still cannot figure what is wrong with that code.

Thanks again.


A lot has gone on with control arrays over the last three releases. If you’re going that route, instantiate the controls directly with “new” and add them manually to the container. Also, keep track of your dynamic controls in an array. The “Add” syntax and the trick for counting them has been problematic. I know Greg fixed a bunch of things, but it might be one of those things that’s just so awkward that it can’t be totally saved from itself.

Here’s a clip I use to create a new user icon (ccSignInUser) on a page. “user” is actually a dynamic control that I keep invisible. Only reason is that I was straddling the Add style and new style of creation while issues were being fixed in the framework. dynamicUsers is my array of these things I created.

[code] dim result as ccSignInUser

// result = Adduser

result = new ccSignInUser
result.EmbedWithin(self, -100 - user(0).Width, -100 - user(0).Height, user(0).Width, user(0).Height)
AddHandler result.Clicked, WeakAddressOf UserClicked

result.ScrollbarsVisible = 2

result.visible = false

return result[/code]


I will continue experimenting with alternate solutions. Right now, I think that scrolling the data table on a fixed array of text fields is probably the most convenient approach for my intended purpose. (a configuration screen for a master menu. The menu will be handled with a Taylor-Design Treeview. If you know the main screen of the SAP GUI, you have a good idea of what I have in mind. The configuration screen will handle things such as the tree structure and organisation-wide security features. User security will modulate the master application menu further). The whole thing is kept in a database. IN fact, my whole application is database driven: on-the-fly localisation of screens (not just language, but also client-specific terminology), menu structure, etc.