B4J Question [ABMaterial] Multiple Editors

alienhunter

Active Member
Licensed User
Longtime User
Hi

i try to add multiple editors to a list
it seems it does not work , i want to display the messages in HTML code
any hints
thanks AH

B4X:
Sub BuildItemlist(id As String, icon As String,ids As String,dinotext As String,isnew As Boolean) As ABMContainer
    
    Dim usercount As ABMContainer
    usercount.Initialize(page, "usercount", "centercontent")
    usercount.Tag=ids
    usercount.AddRowsM(1,True,0,0,"centercontent").AddCellsOSMP(1,0,0,0,3,3,3,6,0,0,0,"centercontent")
    usercount.AddRows(1,True,"").AddCells12(1,"")
    usercount.BuildGrid ' IMPORTANT!
#End Region

    Dim lbl As ABMLabel
    lbl.Initialize(page, "lbl1", "Message ID : " &  ids, ABM.size_h5, False, "")
    lbl.VerticalAlign = True
    lbl.IconName = icon
    lbl.Tag=dinotext
    usercount.Cell(1,1).AddComponent(lbl)
    
    Dim editor2 As ABMEditor
    editor2.Initialize(page, "editor2" & ids, True, False, "editor")
    editor2.SetHTML(dinotext)
    editor2.Refresh
    usercount.Cell(2,1).AddComponent(editor2)


'    usercount.Cell(2,1).AddComponent(ABMShared.BuildHeader(page, "hdr1", dinotext))

    Return usercount
End Sub
 

Descartex

Well-Known Member
Licensed User
Longtime User
Hi,
Try to refresh the cell after adding a component:
B4X:
usercount.Cell(2,1).Refresh

Regards.
 
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
multiple editors in a list? That is probably not such a good idea. An ABMEditor is an iframe (like a complete webpage, including headers, its own css, its own javascript etc...) So 10 editors in a list is like opening 10 full webpages at once.

I could not find other option to display the text entered in the editor , since the text saved is like you said a complete webpage

have to strip out the html to save as text so it works on other B4x

B4X:
    Dim updatetext As String=editor.GetHTML.Replace("<div>","").Replace("</div>","").Replace("<br>","").Replace("<b>","").Replace("</b>","")

this way i can display it in a lbl or so

Capture.JPG

or is there another way to enter a simple text ?
thanks AH
 
Upvote 0
Top