Private Sub RefreshOnLoad_flex598()
Dim flex598 As ABMFlexWall
flex598 = page.Component("flex598")
'Get the album folder from session
Dim Album As String = page.ws.Session.GetAttribute("album")
Dim ParentFolder As String = page.ws.Session.GetAttribute("parentfolder")
If Album.Length = 0 Then Return
page.NavigationBar.Title = Album
Dim fStructure As String = "www" & "/" & AppName & "/"
If ParentFolder.Length > 0 Then
fStructure = fStructure & ParentFolder & "/"
End If
fStructure = fStructure & Album
Dim pStructure As String = fStructure
pStructure = pStructure.Replace("www/" & AppName, "..")
fStructure = File.Combine(File.DirApp, fStructure)
'Define list to store the results of the query
page.Pause
Dim albumPhotos As List = File.ListFiles(fStructure)
Dim photoCnt As Int = 0
Dim photoID As String
For Each strPhoto As String In albumPhotos
photoCnt = photoCnt + 1
photoID = "photo" & photoCnt
strPhoto = pStructure & "/" & strPhoto
Dim img As ABMImage
img.Initialize(page, photoID, strPhoto, 1)
img.IsResponsive = True
img.Caption = strPhoto
img.IsCircular = False
img.IsClickable = False
img.IsMaterialBoxed = True
flex598.AddImage(img, 350, 350)
Next
flex598.Refresh
page.Resume
End Sub