Android Question BBCodeView on B4XPages sometimes does not display correctly

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I have this simple code
B4X:
B4XPages.ShowPage("pageHelp")
pageHelp.ShowHelp("InfoAbout")

Mostly, it worked fine, but sometimes, it just showed blank page.
After that, if called again, worked OK again.

Why?
Using B4A 13.40
 

incendio

Well-Known Member
Licensed User
Longtime User
The information you provided is too limited to give you an answer.

Enable:
B4XPages.GetManager.LogEvents = True
and also add your own log lines to find out why.
B4XPages.GetManager.LogEvents = True already set.

It was the actual codes, just like that, no others codes after a call to showhelp.
Sub showhelp use BBTextEngine, could it be the reason, because I have experience similar result with other page that use the same engine.

I will show codes inside showhelp after around my computer again.

This behavior is quite difficult to trace because it was not always happened, also, tested with others device, behavior were different.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
to help you we first need to understand how you are creating the pages, and adding them to the stack, so the code you have shown is insufficient
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Edit
===
It was BBCodeView that does not display correctly, don't know if this is related on B4XPages or not, probably not.


Have 3 pages, page1 and page2 and pageHelp.

Page1 call
B4X:
B4XPages.ShowPage("pageHelp")
pageHelp.ShowHelp("InfoAbout")
then after pageHelp showed up scroll to the bottom, close this page, immediately call page2 then call
B4X:
B4XPages.ShowPage("pageHelp")
pageHelp.ShowHelp("Company")

pageHelp showed up but not correctly, see attachment picture.
If pageHelp not scrolled after called by page1, subsequent call to pageHelp from page2 display correctly.

BBHelp in page1 is a lot longer and lots picture than in page2.

Codes on pageHelp
B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private BBHelp As BBCodeView
    Private TextEngine As BCTextEngine
    Private lblLoc2 As Label
    Private MaxWidth As Float
    Private xui As XUI
    Private pnlTitle As Panel
End Sub

'You can add more parameters here.
Public Sub Initialize As Object
    Return Me
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("lyHelp")
    lblLoc2.Text  = Main.PUB_CMPNY_NM
    TextEngine.Initialize(Root)
    BBHelp.ParseData.DefaultFont = xui.CreateDefaultFont(Main.PUB_FONT_SIZE)       
    MaxWidth = 100%x/GetDeviceLayoutValues.Scale-10dip       
End Sub

Sub ShowHelp(Module As String)
    If Module = "Company" Then
        BBHelp.Text = $"...."$
    else If Module = "InfoAbout" Then
        BBHelp.Text = $"...."$
    else If Module = "Hardware" Then
        BBHelp.Text = $"...."$
    End If
End Sub

On page2, after that strange display, close pageHelp, then call it again, it will display correctly.
Seem like BBCodeview need a time to refresh, don't know what.

It was always like that, a call to pageHelp on page2 after pageHelp called and scrolled, produced same result.
 

Attachments

  • ss.jpg
    ss.jpg
    11.6 KB · Views: 8
Upvote 0
Top