B4J Question [SOLVED][ABMaterial] hide show component

micro

Well-Known Member
Licensed User
Longtime User
Hi to all
how i can show or hide component at runtime?
I have a ABMContainer with 3 ABMImage and based on certain events I have to hide or view images.
In the property for ABMImage is present only visibility function to allow viewing on various devices.
Thanks

P.S.
Now use opacity for hide/show but it is not very elegant.
 
Last edited:

Harris

Expert
Licensed User
Longtime User
Check this for examples of visibility...

B4X:
'  this hides or shows rows...

    If reportparams.Get("p1") = "0" Then  
        cnt1.Row(3).Visibility = ABM.VISIBILITY_HIDE_ALL
        cnt1.Row(4).Visibility = ABM.VISIBILITY_HIDE_ALL
    Else
        cnt1.Row(3).Visibility = ABM.VISIBILITY_ALL ' show all...
        cnt1.Row(4).Visibility = ABM.VISIBILITY_ALL
    End If  

' this hides / shows whatever is in the cell...

  page.Cell( 2, 1).Visibility = ABM.VISIBILITY_ALL 


'  this hides or shows components in a container....  Note the cn.refresh is required to update the state.

Sub img1_Clicked(target As String)
    Dim cn As ABMContainer = page.Component("cnt1")
  
    Dim bt1 As ABMButton = cn.Component("btncomp")
    Dim cnv As ABMImage = cn.Component("img1")
    cnv.Visibility = ABM.VISIBILITY_HIDE_ALL
    bt1.Visibility = ABM.VISIBILITY_ALL
      
    cn.Refresh
  
End Sub
 
Last edited:
Upvote 0

Harris

Expert
Licensed User
Longtime User
Simply, but I confused the way of operating with visibility.

Simply, but I WAS confused the way of operating with visibility?

or

Simply, but I Am Still confused the way of operating with visibility?

Either way, it is pretty simple actually... Hide/Show component, row or cell - then refresh the same.
 
Upvote 0
Top