Hi,
Encountered interesting issue.
I added a CustomListView (xCustomListView) Control in one layout
Then I created a panel in a second layout and added one view (checkbox) to the panel and in the designer I made the panel the controls parent.
I then changed the Checkbox Control to a B4X view in the declarations of the module.
I then opened the form with layout1 and added a number of panels in the customListControl using layout2
When I came to access the controls on each panel in code they were not reachable. Listoutofbound error.
When I checked the only view in the panel was the panel itself.
When I went back into my second layout and made the Main the parent instead of the panel I could then access the controls from code.
The panel then showed 2 views
Here is the code snippet
Sub CheckAllItems(check As Boolean)
For i = 0 To clv1.GetSize - 1
Dim p As B4XView = clv1.GetPanel(i)
Log(p.NumberOfViews)
Dim ch As B4XView
ch = p.GetView(1)
'1 = a checkbox
ch.Checked = check
'
Next
End Sub
When the panel was the parent in designer then log(p.numberofviews) returned 1
when Main was the parent in the designer then log(p.numberofviews) returned 2
Should not the parent be the Panel?
Not a problem except for Anchoring Items may be harder
Many thanks
Ian
I'm using B4J 6.51
xCustomListView 1.63
and jXUI 1.80
Encountered interesting issue.
I added a CustomListView (xCustomListView) Control in one layout
Then I created a panel in a second layout and added one view (checkbox) to the panel and in the designer I made the panel the controls parent.
I then changed the Checkbox Control to a B4X view in the declarations of the module.
I then opened the form with layout1 and added a number of panels in the customListControl using layout2
When I came to access the controls on each panel in code they were not reachable. Listoutofbound error.
When I checked the only view in the panel was the panel itself.
When I went back into my second layout and made the Main the parent instead of the panel I could then access the controls from code.
The panel then showed 2 views
Here is the code snippet
Sub CheckAllItems(check As Boolean)
For i = 0 To clv1.GetSize - 1
Dim p As B4XView = clv1.GetPanel(i)
Log(p.NumberOfViews)
Dim ch As B4XView
ch = p.GetView(1)
'1 = a checkbox
ch.Checked = check
'
Next
End Sub
When the panel was the parent in designer then log(p.numberofviews) returned 1
when Main was the parent in the designer then log(p.numberofviews) returned 2
Should not the parent be the Panel?
Not a problem except for Anchoring Items may be harder
Many thanks
Ian
I'm using B4J 6.51
xCustomListView 1.63
and jXUI 1.80