B4J Question [ABMaterial] ABMContainer InitializeCollapsable

alienhunter

Active Member
Licensed User
Longtime User
hi ,
I am looking for some help how to make a collapsable container in ABM
i do not know what is needed for header and body

I got this part
B4X:
    Dim usercount As ABMContainer
    Dim collapse As ABMContainer
    Dim collapsez As ABMContainer

    usercount.InitializeCollapsable(page, "usercount", "centercontent","centercontent","centercontent",True)

?  >> needs this ?  usercount.CollapsableHeading.Initialize(page,"collapsax","centercontent")
?  >> needs this ?  usercount.CollapsableBody.Initialize(page,"collapsa","centercontent")

but ..
B4X:
This container is collapsable.  Use CollapsableHeader/CollapsableBody!
i can not find anything on this

thank you
AH
 

alwaysbusy

Expert
Licensed User
Longtime User
You do not need to initialize the header nor the body:

B4X:
Sub BuildCard(res As Map) As ABMContainer
   Dim tmpCard As ABMContainer
   tmpCard.Tag = res.Get("regid")
   tmpCard.InitializeCollapsable(page, "Card" & res.Get("regid"), "zdepthgrey", "", "white", False )
   
       ' initialize header
   tmpCard.CollapsableHeading.AddRowsM(1, False, 0,0,"").AddCellsOSMP(1,0,0,0,12,4,4,0,0,20,20,"").AddCellsOSMP(1,0,0,0,12,8,8,0,0,20,20,"")
   tmpCard.CollapsableHeading.BuildGrid
   
       ' initialize body
   tmpCard.CollapsableBody.AddRowsM(1, False,0 ,0,"").AddCellsOSMP(1,0,0,0,10,11,11,0,0,20,20,"").AddCellsOSMP(1,0,0,0,2,1,1,20,0,0,20,"")
   'tmpCard.CollapsableBody.AddRowsM(1, True ,20,10, "").AddCellsOS(1,6,6,6,3,3,3,"cellright").AddCellsOS(1,0,0,0,3,3,3,"cellright")
   tmpCard.CollapsableBody.BuildGrid
       
   DateTime.DateFormat = "yyyy-MM-dd"
   DateTime.TimeFormat = "HH:mm:ss"   
   Dim tmpStr As String = res.Get("regtimestamp")
   Dim tmpDate As Long = DateTime.DateTimeParse(tmpStr.SubString2(0,10),tmpStr.SubString2(11,19))       
   DateTime.DateFormat = "dd/MM/yyyy"
   DateTime.TimeFormat = "HH:mm"       
   Dim tmpCardDate As ABMLabel
   tmpCardDate.Initialize(page, "CardDate" & res.Get("regid"), DateTime.Date(tmpDate) & " " & DateTime.Time(tmpDate), ABM.SIZE_H6, True, "")
   'tmpCardDate.IsBlockQuote = True
   tmpCard.CollapsableHeading.Cell(1,1).AddComponent(tmpCardDate)
       
   Dim tmpCardType As ABMLabel
   tmpCardType.Initialize(page, "CardType" & res.Get("regid"), res.Get("itcode"), ABM.SIZE_H6, True, "")
   tmpCardType.IconName = "fa fa-expand"
   tmpCardType.IconSize = ABM.ICONSIZE_SMALL
   tmpCardType.IconAlign = ABM.ICONALIGN_RIGHT
   'tmpCardType.IsBlockQuote = True
   tmpCard.CollapsableHeading.Cell(1,2).AddComponent(tmpCardType)
       
   Dim tmpCardEditor As ABMEditor
   tmpCardEditor.Initialize(page, "CardEditor" & res.Get("regid"), False, False, "")
   tmpCard.CollapsableBody.Cell(1,1).AddComponent(tmpCardEditor)
   
   Dim tmpCardEdit As ABMButton
   tmpCardEdit.InitializeFloating(page, res.Get("regid"), "mdi-action-visibility", "")
   tmpCard.CollapsableBody.Cell(1,2).AddArrayComponent(tmpCardEdit, "tmpCardEdit")
   
   Return tmpCard
End Sub
 
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
hi
it wont collapse nor expand
it is getting the right id .... hmmm
thanks AH


B4X:
Sub eventslist_Clicked(ItemId As String)
'
    Try
        Dim eventlist As ABMList=page.Component("eventslist")
        Dim avblblb As ABMContainer = eventlist.Item(ItemId)
        Log("CONTAINER : " & avblblb.ID)
        avblblb.CollapsableHeading.SetContentIsOpen(False)
        avblblb.CollapsableBody.SetContentIsOpen(False)

'        avblblb.CollapsableHeading.SetContentIsOpen(True)
 '       avblblb.CollapsableBody.SetContentIsOpen(True)

        Log(avblblb.Tag)
    Catch
        Log(LastException)
    End Try
  
End Sub



Sub BuildSimpleItem2(idx As String, id As String, icon As String, Title As String, pickuplocation As String ,pickupdate As String , _
    dateava As String , totalwei As String , shiptype As String ) As ABMContainer

    Dim usercount As ABMContainer
    usercount.InitializeCollapsable(page,"usercount"&id, "centercontent","","",False)
    usercount.Tag=id
  
  
  
    usercount.CollapsableHeading.AddRows(1,True,"").AddCellsOS(2,0,0,0,6,6,6,"")
    usercount.CollapsableHeading.BuildGrid


    usercount.CollapsableBody.AddRows(1,True,"").AddCellsOS(2,0,0,0,6,6,6,"")
    usercount.CollapsableBody.AddRows(2,True,"").AddCells12(1,"")
    usercount.CollapsableBody.AddRows(2,True,"").AddCellsOS(2,0,0,0,6,6,6,"")
    usercount.CollapsableBody.BuildGrid ' IMPORTANT!

Capture.PNG
 
Upvote 0
Top