Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Textedit Presentation Styles  (Read 13519 times)
David H.
Posts: 158


« on: October 15, 2013, 11:37:44 am »

Hi All,

I was having a play around with the RichText widget demos. I wanted to alter on the fly the style of a Textedit between plain and html, depending upon the content. In the attached example V2 works ok, but V1 does not (no toolbar and any text entered is lost). I'm not sure if this is a bug or me simply misusing it! I get the same behavior on multiple versions between v2.30 and the latest v2.50 beta.

TIA,

David

* texttest2.zip (1.75 KB - downloaded 678 times.)
David H.
Posts: 158


« Reply #1 on: October 23, 2013, 10:15:35 am »

Anyone? I would like to know one way or the other, if this is an issue of my own making, a feature or a bug...
Sebastien F.
Four Js
Posts: 509


« Reply #2 on: October 23, 2013, 10:47:38 am »

Hello David,

Front-end implementers can say a word, but I think we are not ready to switch from rich-text/plain-text dynamically, and if it works it's by accident.

Could you please elaborate?
Why do you need to switch modes?

If it's to show the "html source", could you not just add a button to open a new window to show the plain text?

Seb
David H.
Posts: 158


« Reply #3 on: October 23, 2013, 11:22:07 am »

Hi Seb,

Thanks for the response. We have a notes facility in our applications (which are plain text only currently), where users can attach one or more timestamped notes to a record. We would like to add the facility to use html notes to give the users a richer user experience. If we add this then a user will potentially have a mixture of html and plain text notes, which could alter as they scroll up and down their lists of notes (presented as a single form). As an alternative, if there was some way to convert  the plain text notes into basic html then I guess we could use html only for the presentation. I had a look at this but it does not look like a trivial exercise...

David
Sebastien F.
Four Js
Posts: 509


« Reply #4 on: October 23, 2013, 12:01:03 pm »

Ok now we better understand the need.
We have to check with the front-end implementers, but after testing with GDC 2.50, it appears that when richtext/html is enabled, if you display some plain text, it's properly displayed. When you modify the content, it is converted to html and thus becomes automatically richtext content.
This is to me an ok behavior, but needs to be confirmed and documented.
Seb
David H.
Posts: 158


« Reply #5 on: October 23, 2013, 03:56:35 pm »

Hi Seb. That is what I initially hoped might happen, but in my tests, using Gdc v2.50.03 on Windows, the plain text did not display well when rendered via the richtext control (see attached)



* Screenshot - 23_10_2013 , 14_40_13.png (27.3 KB, 787x454 - viewed 1401 times.)

* Screenshot - 23_10_2013 , 14_42_28.png (25.38 KB, 787x454 - viewed 1431 times.)
Sebastien F.
Four Js
Posts: 509


« Reply #6 on: October 23, 2013, 05:12:22 pm »

Ok...

This is not in my hands, if you get no further answer in this thread, I suggest that you report a problem to the support, we will then advice and decide if it's a feature or a bug.

But for now, I would not rely on an undocumented behavior.

If you plan to update all non-HTML data in your database to HTML, consider the amount of data needed for additional HTML tags (see the diff before and after with original plain text)

I am not 100% convinced that it's a good idea to introduce richtext in a business application. Data should remain easy to process... A query/search for the text "body" will return all rows ;-)

Seb
Reuben B.
Four Js
Posts: 1049


« Reply #7 on: October 24, 2013, 03:10:22 am »


This post was a pain to type because the forum uses an HTML editor as well.  Where I have typed something like < br > < b >, it should read without the spaces.

I'd argue that what you see is the expected behaviour.  In HTML ASCII(10) or LF does not mean start a new line, < br > does http://www.w3schools.com/tags/tag_br.asp

So I suspect you would have to do a search/replace of the CR/LF characters with < br >.

You would also have to be careful where other HTML markup occurs innocently in your plain text.  < b > would have the effect that everything followed would be bold.   Refer to something like this http://www.w3schools.com/html/html_entities.asp. on how to reference those.

As you said, not a trivial exercise, but not impossible

The other thing I'll mention seen you had a screenshot with the GDC.  There is a warning hidden away in the docs right at the bottom here https://4js.com/online_documentation/fjs-gdc-manual-html/User/NewFeatures222.html.  (Im surprised the arning isn't more prominent)   The GDC library we use creates a lot of unnecessary HTML tags which make life interesting when you view the resultant HTML either in GWC or send it through to GRW.  In 2.50 in FGLDIR/demo/WebServices/richtextmigration there is a program to help standardize the html coming out of the GDC richtextedit.




Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines