B4J Question HTMLEditor Tutorial and/or Documentation

RussellM72

Member
Licensed User
Hello! I'm working on a project where I would like to be able strike through lines of text as a means of showing that a step has been done. It seems that only the HTMLEditor is capable of showing styled text (in a field where the user can edit text). However, I can not figure out some things about the HTMLEditor:

  • Is .HtmlText the only method that returns the contents of the widget?
  • Are there any existing libraries or methods for parsing the html or converting it to a format that is easier to work with?
  • Is it possible to programmatically highlight characters, words, or lines of text in an HTMLEditor?
  • Is there a tutorial on using the HTMLEditor?
Thanks in advance for any advice or help.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are two options for an editable rich text control: HTMLEditor or a WebView editor such as CKEditor: https://www.b4x.com/android/forum/threads/b4x-webview-ckeditor-rich-text-editor.133260/#content

HTMLEditor is quite a black box. It is difficult to customize it.

1. Yes.
2. There are three html parsers: jTidy, jSoup and MiniHtmlParser: https://www.b4x.com/android/forum/pages/results/?query=html+parser+&prefix=1,2,3,17,24,29
3. You get get the html, modify it and set it back.
4. The basic usage is very simple. You add the view with the designer and the user can enter rich text.
Relevant discussions: https://www.b4x.com/search?query=htmleditor
 
Upvote 0

RussellM72

Member
Licensed User
Thanks for the reply. It does seem that the HTMLEditor won't work the way I need it to. It seems that the user can click and highlight text inside of the HTMLEditor but that it isn't really possible to do it programmatically like you can with TextArea.SetSelection.

I'm curious about the CKEditor but, looking at the posts about it, I would need a bit more direction about how to include it in my B4J project. I'm brand new to B4X and still learning.

I'm starting to think I should just do something simpler, like add a unicode checkmark character at the beginnings of lines or add a suffix like "- [sent]" to the ends of lines and just stick with the TextArea.

Just out of curiosity, how likely is it that B4X will ever get a TextArea that supports rich text that isn't HTML based? The other programming environments I've used had this and I was a little surprised that B4X/J doesn't?

Thanks again for your reply and thanks for making such a cool development platform. I will definitely be making a donation or purchasing B4i.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Just out of curiosity, how likely is it that B4X will ever get a TextArea that supports rich text that isn't HTML based? The other programming environments I've used had this and I was a little surprised that B4X/J doesn't?
There is no native rich text editor control in Android or iOS.
If you can use a non-editable control then there are several good options.

I'm curious about the CKEditor but, looking at the posts about it, I would need a bit more direction about how to include it in my B4J project. I'm brand new to B4X and still learning.
Download the example and run it. It should work.
 
Upvote 0

RussellM72

Member
Licensed User
There is no native rich text editor control in Android or iOS.
If you can use a non-editable control then there are several good options.
Understood but, for the moment, I'm focused on desktop (B4J). So, are you saying that because the mobile platforms don't have a native rich text control that you won't provide one for desktop?
Download the example and run it. It should work.
I will try it.

Thanks.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top