Wish B4XTable1 - Visible property

aeric

Expert
Licensed User
Longtime User
While it is possible to modify the class but it is much easier to put it inside a Pane/Panel and set the Pane's visibility.
 

peacemaker

Expert
Licensed User
Longtime User
B4X:
Public Sub getVisible As Boolean
    Return mBase.Visible
End Sub

Public Sub setVisible (NewVisibility As Boolean)
    mBase.Visible = NewVisibility
End Sub

Let's add everywhere
 

LucaMs

Expert
Licensed User
Longtime User
While it is possible to modify the class but it is much easier to put it inside a Pane/Panel and set the Pane's visibility.
This is easy (and currently the way to do it):
B4XTable1.mBase.Visible = True
but Visible is a property that every view should have and Erel will take 5 seconds to add it.
 

aeric

Expert
Licensed User
Longtime User
In case Erel is busy with other important things, here is my mod.
 

Attachments

  • B4XTableVisible.b4xlib
    14.3 KB · Views: 189
  • Example.zip
    9.1 KB · Views: 201

aeric

Expert
Licensed User
Longtime User
I am not sure if it is a bug.
It doesn't matter if I set the Visible (Common Properties) value to True or False, it will be Visible when the app starts. I only tested in B4J.

We need to set the Visible to False by code in B4XPage_Created.
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    B4XTable1.AddColumn("Sample", B4XTable1.COLUMN_TYPE_TEXT)
    B4XTable1.Visible = False ' setting in Designer has no effect
    'Pane1.Visible = False
End Sub
 

Attachments

  • B4XTableVisible.b4xlib
    14.3 KB · Views: 174
  • Example2.zip
    9.2 KB · Views: 212

LucaMs

Expert
Licensed User
Longtime User
I am not sure if it is a bug.
It doesn't matter if I set the Visible (Common Properties) value to True or False, it will be Visible when the app starts. I only tested in B4J.

We need to set the Visible to False by code in B4XPage_Created.
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    B4XTable1.AddColumn("Sample", B4XTable1.COLUMN_TYPE_TEXT)
    B4XTable1.Visible = False ' setting in Designer has no effect
    'Pane1.Visible = False
End Sub
It's not a bug. Not all properties common to all views affect custom views.
 

aeric

Expert
Licensed User
Longtime User
It's not a bug. Not all properties common to all views affect custom views.
The expected behavior is when we uncheck the value in Designer, it should not shown in the UI.
If we use the original library provided by Erel, the view is still showing even though we have set mBase.Visible = False in B4XPage_Created.
 

LucaMs

Expert
Licensed User
Longtime User
I am not sure if it is a bug.
It doesn't matter if I set the Visible (Common Properties) value to True or False, it will be Visible when the app starts. I only tested in B4J.

We need to set the Visible to False by code in B4XPage_Created.
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    B4XTable1.AddColumn("Sample", B4XTable1.COLUMN_TYPE_TEXT)
    B4XTable1.Visible = False ' setting in Designer has no effect
    'Pane1.Visible = False
End Sub
You should use:

mBase.Visible = Lbl.Visible
 
Top