B4J Question [ABMaterial] ABMEditor get the content?

Dianzoa

Active Member
Licensed User
Hello, I use the example in the demo page, editor.GetHtml, but it returns empty, I try to get the whole string to store in a database, is it possible?

B4X:
Sub btn1_clicked(target As String)
'    Dim serverurl As String
    Dim fec As String
   
    DateTime.DateFormat = "dd/MM/yyyy"
    fec = DateTime.Date(DateTime.Now)
    Dim job As HttpJob
    Dim serverurl As String
    serverurl = "guardar_plantilla_presupuesto.aspx?"
    'serverurl = "guardar_plantilla_presupuesto.aspx?doc=" & "hola que tal"
    job.Initialize("job1",Me)
    job.Download2(serverurl, Array As String("doc",editor.GetHTML,"fecalta",fec,"usualta","ccandia","titulo","Presupuesto Prueba","tags","prueba"))
   
End Sub
 

Dianzoa

Active Member
Licensed User
Ok, this way it works. I create another instance of editor and assign the original ABMEditor object, I thought since the declaration of editor is global, I could access directly in other parts of the code. Apparently not.

B4X:
Sub btn1_clicked(target As String)
'    Dim serverurl As String
    Dim fec As String
    Dim doc As String
    Dim editor1 As ABMEditor
    editor1 = page.Component("editor")
    doc = editor1.GetHTML
    DateTime.DateFormat = "dd/MM/yyyy"
    fec = DateTime.Date(DateTime.Now)
    Dim job As HttpJob
    Dim serverurl As String
 
Upvote 0
Top