B4J Question [banano] loop problem for banano layout..why this code dont work?

tango

Active Member
Licensed User
Longtime User
B4X:
                Dim Layout As SKLayout
                Layout = Layout.Initialize(Me, "body" )
                Layout.AddFlexColumns(1,12,12,12, "center" )
                Layout.LastRow.Column(1).MarginTop = "20px"
                Layout.LastRow.Column(1).MarginBottom = "20px"

                For i=1 To 5
                    Dim name1 As String=i
                    Dim event1 As String="txtname"&i
                    Dim txtbox As SKTextBox =Layout.LastRow.Column(1).Add.TextBox( name1, event1, "" , "" , True, "Type some text..." , "label" , "" , "" , "text" , False)
                Next

why this code dont work?
 

Mashiane

Expert
Licensed User
Longtime User
Add.TextBox( name1,
HTML nodes cannot have an id that starts with a number

B4X:
Add.TextBox( name1,

Perhaps replace name1 to event1 and see if it works, because from the look of your code, I assume the name1 is the "id" of the element.

Have not used skeleton, so I wouldnt be 100% sure what that does but looking at your for loop,

Good luck.
 
Upvote 0
Top