B4J Question [ABMaterial] bugreport

peacemaker

Expert
Licensed User
Longtime User
HI, All and @alwaysbusy
Lib version 5.0, Chrome v.104.0.5112.102 64bit.
I just wanted to mention that

ABMCombo​

_Clicked event works, but _Changed - not.
B4X: Copy
    Dim combo1 As ABMCombo
    combo1.Initialize(page, "cboLang", "Select a {B}person{/B}", 650, "")
    combo1.IconName = "mdi-action-account-circle"
    ' add items
    combo1.AddItem("combo1S1", "Mom", BuildSimpleItem("S1", "mdi-action-account-circle", "{NBSP}{NBSP}Mom"))
    combo1.AddItem("combo1S2", "Dad", BuildSimpleItem("S2", "mdi-action-account-circle", "{NBSP}{NBSP}Dad"))
    combo1.AddItem("combo1S3", "Brother", BuildSimpleItem("S3", "mdi-action-dashboard", "{NBSP}{NBSP}Brother"))
    combo1.AddItem("combo1S4", "Sister", BuildSimpleItem("S4", "mdi-action-dashboard", "{NBSP}{NBSP}Sister"))
    page.cell(2,1).AddComponent(combo1)
    ....
 
 
Sub cboLang_Changed(value As String)   'NOT RAISED AT ALL
    Log(value)
End Sub
Sub cboLang_Clicked(itemId As String)    'Works OK
    Log(itemId)
End Sub
 
Last edited:
_Clicked event works, but _Changed - not.
You have to explicitly enable this event. By default it is not to reduce client - server roundtrips.

Code: Copy
cmb.RaiseChangedEvent = true

page.NavigationBar.Open - does not work.
Try this snippet:

Code: Copy
page.ws.Eval("$('#sidenavbutton').click();", Null)
page.ws.Flush

Alwaysbusy
 
Upvote 0
B4X: Copy
MyTheme.AddNavigationBarTheme("nav1theme")
MyTheme.NavigationBar("nav1theme").TopBarFontSize = "10px"
Font size does not work.
B4X: Copy
page.NavigationBar.UseTheme("nav1theme")    'does not help in ConnectPage
 
Upvote 0
B4X: Copy
page.SetAcceptedLanguages(Array As String("ru", "en", "es"), "en")
Dim ActiveFoundLanguage AsString = page.DetectLanguage(ws.UpgradeRequest.GetHeader("Accept-Language"))
page.SetActiveLanguage(ActiveFoundLanguage, "" )
Does not work in Chrome, it returns:
ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
But detected always "en".

MS Edge returns:
en-GB,en;q=0.9,en-US;q=0.8

So, i use:
B4X: Copy
Dim browser_lang As String = ws.UpgradeRequest.GetHeader("Accept-Language").SubString2(0, 2).ToLowerCase
 
Upvote 0
Font size does not work.
You are probably thinking this is the size of the title, but it is not. It is the font size of the menus/buttons on the right. The title font size is regulated by the Materialize CSS framework and changes automatically on screen size. It can not be modified.
Does not work in Chrome, it returns:
I can not reproduce this. works correct here:

Code: Copy
Log(ws.UpgradeRequest.GetHeader("Accept-Language"))
' accepts fr, de and nl and if non of these is found, use en
AppPage.SetAcceptedLanguages(Array As String("fr", "de", "nl"), "en")
ActiveFoundLanguage = AppPage.DetectLanguage(ws.UpgradeRequest.GetHeader("Accept-Language"))
Log(ABMShared.FormatDateTimeNow(Name) & "Users browser language: " & ActiveFoundLanguage)

Code: Copy
en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7   '<-------- nl is found in the list so it takes nl
[ABMApplication: 2022-14-09 09:12:19] Users browser language: nl

if I use:
Code: Copy
' accepts fr, de and ru and if non of these is found, use en
AppPage.SetAcceptedLanguages(Array As String("fr", "de", "ru"), "en")

Code: Copy
en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7   '<-------- fr, de and ru are not found in this list, so use en
[ABMApplication: 2022-14-09 09:14:22] Users browser language: en

Alwaysbusy
 
Upvote 0
Back
Top