B4J Question [ABMaterial] Why ABMChronologyList all on left side !?

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

Use ABMaterial 2.51. I show ABMChronologyList in the container of every tab. I don't know why they always show on left side. Why :(

chrono.Initialize(page, "chrono", "chrono")
chrono.AddSlide("Slide1", BuildFiche(1, "大甲高中", "台中市大甲區中山路一段 720 號","", "green"), "green")
chrono.AddSlide("Slide2", BuildFiche(2, "私立致用高中", "台中市大甲區東陽新村 71 號","", "green"), "green")
chrono.AddSlide("Slide3", BuildFiche(3, "國立大甲高工", "台中市大甲區頂店里開元路 71 號","", "green"), "green")
Tabc.Cell(1,1).AddComponent(chrono)

c630be687bd281cfa6aa1f1290591f1b.png

B4X:
Sub BuildFiche(id As String, Title As String,Subtitle As String, pic As String, themeName As String) As ABMContainer
    Dim Fiche As ABMContainer
    Fiche.Initialize(page, "fiche" & id, "")

    Fiche.AddRowsM(1, False,0,0, themeName).AddCellsOSMP(1,0,0,0,12,12,12,0,12,10,10,"")
    If themeName = "black" Then
        Fiche.AddRowsM(1, False,0,0, "").AddCellsOSMP(1,0,0,0,12,12,12,0,0,0,0,"")       
    Else
        Fiche.AddRowsM(1, True,0,0, "").AddCellsOSMP(1,0,0,0,12,12,12,0,0,0,0,"")
    End If
    If themeName = "red" Then
        Fiche.AddRowsM(1, True,0,10, "").AddCellsOSMP(1,0,0,0,12,12,12,0,0,0,0,"")       
    End If
   
    Fiche.BuildGrid
    If themeName = "black" Then
        Fiche.Row(2).MarginLeft = "auto"
        Fiche.Row(2).MarginRight = "auto"       
    End If
   
    Fiche.Row(1).MarginLeft = "0"
    Fiche.Row(1).MarginRight = "0"
   
    Dim titLabel As ABMLabel
    titLabel.Initialize(page, "titlabel" & id, Title, ABM.SIZE_H5,False, "white")
    Fiche.Cell(1,1).AddComponent(titLabel)
    Dim titLabel2 As ABMLabel
    titLabel2.Initialize(page, "titlabel2_" & id, Subtitle, ABM.SIZE_H6,False, "white")
    Fiche.Cell(1,1).AddComponent(titLabel2)
   
    If pic <> "" Then
        Fiche.Cell(2,1).AddComponent(ABMShared.BuildImage(page, "ficheimg" & id, pic,1, "Garden"))
    End If
   
   
    Return Fiche   
End Sub

public Sub BuildPage()
    ' initialize the theme
    BuildTheme
   
    ' initialize this page using our theme
    page.InitializeWithTheme(Name, "/ws/" & ABMShared.AppName & "/" & Name, False, ABMShared.SessionMaxInactiveIntervalSeconds, theme)
    page.ShowLoader=True   
    page.ShowLoaderType=ABM.LOADER_TYPE_MANUAL ' NEW
    page.PageTitle = "趣! 大甲"
    page.PageDescription = "history table for data collection system"   
    page.PageHTMLName = "index.html"
    page.PageKeywords = "jinyistudio,iot,plc"
    page.PageSiteMapPriority = "0.50"
    page.PageSiteMapFrequency = ABM.SITEMAP_FREQ_MONTHLY   
    'page.UseGoogleAnalytics(ABMShared.TrackingID, Null) ' IMPORTANT Change this to your own TrackingID !!!!!!!
               
    ABMShared.BuildNavigationBar(page, "學校 School", ABMShared.LogoIcon, "", "livehelp","school")   
   
    ' create the page grid
    page.AddRows(3,True, "").AddCells12(1,"")
    page.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
    '
    Dim tabs As ABMTabs
    tabs.Initialize(page, "tabs", "")
    ' create the tabs As ABMContainer.
    tabs.AddTab("tab1", "托兒所", BuildTabContainer("tab1", "托兒所"),3,3,3,12,12,12,True,False, "", "")
    tabs.AddTab("tab2", "幼稚園", BuildTabContainer("tab2", "幼稚園"),3,3,3,12,12,12,True,False, "", "")
    tabs.AddTab("tab3", "國小", BuildTabContainer("tab3", "國小"),3,3,3,12,12,12,True,True, "", "")
    tabs.AddTab("tab4", "國中", BuildTabContainer("tab4", "國中"),3,3,3,12,12,12,True,False, "", "")
    tabs.AddTab("tab5", "高中職", BuildTabContainer("tab5", "高中職"),3,3,3,12,12,12,True,False, "", "")
    tabs.AddTab("tab6", "大學", BuildTabContainer("tab6", "大學"),3,3,3,12,12,12,True,False, "", "")
    ' add To row
    page.Cell(1,1).AddComponent(tabs)   
    '
    ABMShared.BuildFooter(page)
End Sub

Sub BuildTabContainer(id As String, Text As String) As ABMContainer
    Dim Tabc As ABMContainer
    Tabc.Initialize(page, id,"tabpagewhite")
   
    Tabc.AddRows(1,True, "").AddCells12(1,"")
    Tabc.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
    Dim chrono As ABMChronologyList
    If id="tab3" Then
        chrono.Initialize(page, "chrono", "chrono")
        chrono.AddSlide("Slide1", BuildFiche(1, "東明國小", "台中市大甲區幸福里東明路 93 號","", "green"), "green")
        chrono.AddSlide("Slide2", BuildFiche(2, "順天國小", "台中市大甲區永順街 115 號","", "green"), "green")
        chrono.AddSlide("Slide3", BuildFiche(3, "大甲國小", "台中市大甲區文武里育德路 233 號","", "green"), "green")
        chrono.AddSlide("Slide4", BuildFiche(4, "文昌國小", "台中市大甲區育德路 113 號","", "green"), "green")
        chrono.AddSlide("Slide5", BuildFiche(5, "日南國小", "台中市大甲區中山路二段 568 號","", "green"), "green")
        chrono.AddSlide("Slide6", BuildFiche(6, "西岐國小", "台中市大甲區西岐里順帆路 96 號","", "green"), "green")
        chrono.AddSlide("Slide7", BuildFiche(5, "文武國小", "台中市大甲區武陵里文曲路 61 號","", "green"), "green")
        chrono.AddSlide("Slide8", BuildFiche(5, "華龍國小", "台中市大甲區日南里工二路 1 號","", "green"), "green")
        chrono.AddSlide("Slide9", BuildFiche(5, "德化國小", "台中市大甲區和平路 290 號","", "green"), "green")
        chrono.AddSlide("Slide9", BuildFiche(5, "東陽國小", "台中市大甲區中山里東陽新村 72 號","", "green"), "green")
        Tabc.Cell(1,1).AddComponent(chrono)
    else If id="tab4" Then
        chrono.Initialize(page, "chrono", "chrono")
        chrono.AddSlide("Slide1", BuildFiche(1, "日南國中", "台中市大甲區中山路 2 段 69-11 號","", "green"), "green")
        chrono.AddSlide("Slide2", BuildFiche(2, "大甲國中", "台中市大甲區育英路 186 號","", "green"), "green")
        chrono.AddSlide("Slide3", BuildFiche(3, "順天國中", "台中市大甲區大安港路 67 號","", "green"), "green")
        Tabc.Cell(1,1).AddComponent(chrono)
    else If id="tab5" Then
        chrono.Initialize(page, "chrono", "chrono")
        chrono.AddSlide("Slide1", BuildFiche(1, "大甲高中", "台中市大甲區中山路一段 720 號","", "green"), "green")
        chrono.AddSlide("Slide2", BuildFiche(2, "私立致用高中", "台中市大甲區東陽新村 71 號","", "green"), "green")
        chrono.AddSlide("Slide3", BuildFiche(3, "國立大甲高工", "台中市大甲區頂店里開元路 71 號","", "green"), "green")
        Tabc.Cell(1,1).AddComponent(chrono)
    Else
        Dim lbl As ABMLabel
        lbl.Initialize(page, id & "lbl", "申請中...", ABM.SIZE_H5, True, "")
        Tabc.Cell(1,1).AddComponent(lbl)
    End If   
    Return Tabc
End Sub
 

Harris

Expert
Licensed User
Longtime User
Hi

Sorry ! I move all code form buildpage to coonectpage. It is OK ! :rolleyes:

http://vps.jinyistudio.tw:8010/fun!dajia/SchoolPage

I had same issue in 2.51 (moving from build to connect to make it work).
Have not yet tested in 3.0x

I shall build (3.0x) and test and reply... (soonest). One hates to leave current build - ONLY to discover new problems in next build which you can't explain happened in previous... Yet, problems compound in 2.51 that I can't work around or explain.
I guess, it is time to move up and see what issues still exist.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Sorry ! I move all code form buildpage to coonectpage. It is OK !
This could point in the direction that the initial script did not run. I must admit it has been almost a year since I have added components in the Build and not in the Connect in my personal projects so they may have issues if used in that way that I'm not aware of.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I confirm that there seems to be a bug with chronolist...
Using unchanged code, I was getting a doubled list...

From my testing, I think that, being this control a dynamic array of controls, when creting it in the build page, it seems to be called a second time with the connectpage mechanism... producing a doubled list, in my case ate least.
Changing the chronolist to the connectpage, seems to produce a single chronolist as intented
 
Upvote 0
Top