Android Question B4XTable - Search field not showing

Noelkman

Member
Licensed User
Longtime User
For some reason the search field is not showing. What needs to be checked in order to make this happen or what could it be that turns it off ?
 

Mahares

Expert
Licensed User
Longtime User
For some reason the search field is not showing. What
In the B4XTable Designer there is a box that needs checked for 'Search'
Also, try this code with different colors:
B4XTable1.SearchField.mBase.SetColorAndBorder(xui.Color_Black,5dip,xui.Color_Yellow,10dip)
If all fails, post a screen shot of the table display
 
Upvote 0

Noelkman

Member
Licensed User
Longtime User
Thank you for your answer and sorry about my late answer but I was a few days off.
Here we go,
I tried what you've suggested with no luck.

The Checkbox is set (as per default anyhow)
The B4XTable is Version 1.21
When I use
B4XTable1.SearchField.mBase.SetColorAndBorder(xui.Color_Black,5dip,xui.Color_Yellow,10dip)
I get this:

java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.B4XViewWrapper.SetColorAndBorder(int, int, int, int)' on a null object reference

Is there a special place where I would have to put it?

Please find attached screenshot
 

Attachments

  • Screenshot_20200817-105951.jpg
    Screenshot_20200817-105951.jpg
    259.7 KB · Views: 142
Upvote 0

Noelkman

Member
Licensed User
Longtime User
Oh my goodness I see it myself. Never mind
It is there and it is not sometimes
 
Upvote 0

Noelkman

Member
Licensed User
Longtime User
No luck.
The manifest file has the light theme. I have the Table on Activities and it is working correct there.

Maybe I did it a way that is not working.
I created a Template B4XDialog in a class. The layout file contains a B4XTable.
I design the table in the Initialize block and load data from a web server.
I call it simply this way:
B4X:
    Dim matpicker As B4XwebGetMAT
        
    matpicker.Initialize("")
    
    Dim fnt As B4XFont = xui.CreateFont(Typeface.DEFAULT_BOLD, 18)
        
    Dim cs As CSBuilder
    Dialog.Title = cs.Initialize.Size(24).Append("Material auswaehlen").PopAll
    Dialog.ButtonsFont = fnt
    Dialog.ButtonsTextColor =  xui.Color_RGB(128, 200, 20)
    Dialog.ButtonsColor = xui.Color_rgb(120, 120, 120)
    
    Dim rs As ResumableSub = Dialog.ShowTemplate(matpicker, "Ok", "", "Abbruch")
    
    Wait For (rs) Complete (Result As Int)

I needed a dialog that I can call from any Activity and this works perfect except that the Search Field is not there.
 
Upvote 0

Noelkman

Member
Licensed User
Longtime User
I tried to automatically display the search field within the Class when the dialog is displayed but I got it not working.
But oh miracle the field is displayed when I add a button to the dialog and do this on click:

B4XTable1.Refresh
Sleep(0)

What is the very last Event in the Class that is fired?
Is that "Show" ?
 
Upvote 0
Top