B4J Question [ABMaterial] ActionButton

billyrudi

Active Member
Licensed User
Longtime User
Hi
if i put in builb page this ABMActionButton with visibility to HIDE
B4X:
Dim acb1 As ABMActionButton
    acb1.Initialize(page, "acb1", "mdi-av-timer", "bigblue" )
    acb1.MainButton.Size = ABM.BUTTONSIZE_LARGE
   
    Dim btn1 As ABMButton
    btn1.InitializeFlat (page,   "btn1",  "", ABM.ICONALIGN_LEFT  ,"Mese",  "")
   
    acb1.AddMenuButton(btn1)
   
    btn1.Visibility =  ABM.VISIBILITY_HIDE_ALL
   
    Dim btn2 As ABMButton
    'btn2.InitializeFloating(page, "btn2", "mdi-action-view-module", "sub2")
    btn2.InitializeFlat (page,   "btn2",  "", ABM.ICONALIGN_LEFT  ,"Settimana",  "")
    acb1.AddMenuButton(btn2)
   
    btn2.Visibility =  ABM.VISIBILITY_HIDE_ALL
   
    Dim btn3 As ABMButton
    'btn3.InitializeFloating(page, "btn3", "mdi-action-view-quilt", "sub3")
    btn3.InitializeFlat (page,   "btn3",  "", ABM.ICONALIGN_LEFT  ,"Giorno",  "")
    acb1.AddMenuButton(btn3)
    btn3.Visibility =  ABM.VISIBILITY_HIDE_ALL

how i can make visibility to ALL in the code ?
i have tried this but with no succes!
B4X:
Sub acb1_Clicked(Target As String, SubTarget As String)
    Dim bt1 As ABMActionButton = page.Component("btn1") 'RETURN NULL VALUE
    Dim bt2 As ABMButton = page.Component("btn2")'RETURN NULL VALUE
    Dim bt3 As ABMButton = page.Component("btn3")'RETURN NULL VALUE
   
    If SubTarget="" Then
        bt1.Visibility = ABM.VISIBILITY_ALL
    ' add to page
        bt2.Visibility  = ABM.VISIBILITY_ALL
        bt3.Visibility  = ABM.VISIBILITY_ALL
        Log("clicked main button")
        Return
    End If
    Dim myTexts, myReturns As List
    myTexts.Initialize
    myReturns.Initialize
    myToastId = myToastId + 1
    page.ShowToast("toast" & myToastId, "toastred", "Clicked on " & SubTarget, 5000)
    Return
End Sub

regards Paolo
 

alwaysbusy

Expert
Licensed User
Longtime User
You can try it with something like this:

Dim acb1 as ABMActionButton = page.component("acb1")
Dim btn1 as ABMButton = acb1.MenuButtons("btn1")
Dim btn2 as ABMButton = acb1.MenuButtons("btn2")
Dim btn3 as ABMButton = acb1.MenuButtons("btn3")

But I don't know what the effect of changing the visibility will be as it changes in the javascript/css code behind it (to generate the popover effect)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…