Hi Guys,
So... back again at it!!!
"cont2" is a collapsable container created in the "ConnectPage" sub, using this code;
As you can see it is already inside another container, but this is besides the point.
Inside "cont3", each cell holds a button.
My objective is/was to create a different "CollapsibleBody" grid, depending on which button was clicked...
This is giving me 3 different issues:
1st - First button click does not expand the collapsable body. Second button click does, whiwh then brings me to my second issue:
2nd - Each time the collapsableBody expands, a new row is added... which seems logic... maybe?
3rd - I try to eliminate the 2nd issue by placing a "clearGrid" just before I create it again, but it doesnt work and the Dody ends up empty...
SO.... for the first one... I guess I'm missing an itinial state, but I can't see how to set it...
and for the second and third.... should I just go with a different solution, using one collapsable container for each button?
So... back again at it!!!
"cont2" is a collapsable container created in the "ConnectPage" sub, using this code;
B4X:
Dim cont3 As ABMContainer
cont3.InitializeCollapsable(page, "cont3", "", "", "", False)
cont3.CollapsableHeading.AddRows(1,False,"").AddCellsOS(4,0,0,0,3,3,3,"")
cont3.CollapsableHeading.BuildGrid ' IMPORTANT!
' cont3.CollapsableHeading.OpenContent
' cont3.CollapsableBody.OpenContent
cont2.Cell(1,2).AddComponent(cont3)
cont3.CollapsableHeading.Row(1).Margintop = "75px"
cont3.CollapsableHeading.Row(1).marginBottom = "0"
Inside "cont3", each cell holds a button.
My objective is/was to create a different "CollapsibleBody" grid, depending on which button was clicked...
B4X:
Sub btn1_Clicked(Target As String)
LogError(Target)
Dim FloatingCont1 As ABMContainer = page.FloatingContainer("floatingcont1")
Dim Cont2 As ABMContainer = FloatingCont1.Component("cont2")
Dim collbody As ABMContainer = Cont2.Component("cont3")
collbody.CollapsableBody.ClearGrid
collbody.CollapsableBody.AddRows(1,True,"").AddCellsOS(3,0,0,0,4,4,4,"")
collbody.CollapsableBody.BuildGrid ' IMPORTANT!
' collbody.CollapsableHeading.OpenContent
collbody.CollapsableBody.OpenContent
Dim btn1 As ABMButton
btn1.InitializeFlat(page, "btn1", "", "", "{B}Activitées{/B}", "topbar")
btn1.UseFullCellWidth = True
collbody.CollapsableBody.Cell(1,1).AddComponent(btn1)
End Sub
1st - First button click does not expand the collapsable body. Second button click does, whiwh then brings me to my second issue:
2nd - Each time the collapsableBody expands, a new row is added... which seems logic... maybe?
3rd - I try to eliminate the 2nd issue by placing a "clearGrid" just before I create it again, but it doesnt work and the Dody ends up empty...
SO.... for the first one... I guess I'm missing an itinial state, but I can't see how to set it...
and for the second and third.... should I just go with a different solution, using one collapsable container for each button?