labels, when do they render HTML?

Questions and answers for designing and implementing forms in Servoy

labels, when do they render HTML?

Postby dfrazier » Fri Oct 12, 2012 6:15 pm

I can get a label to render html if I put some html in the text property at design time. However, if I set the text property with the exact same data at runtime, it will not render the html. It just strips out the html and prints the plain text. The same thing happens if I give the label a dataprovider that has html in it. It just strips out the html and prints plain text.

Is there some sort of standard or set of rules that determine when a label will render the html and when it will not? Or is this a bug?

I am using webclient by the way.
This is my signature.
User avatar
dfrazier
 
Posts: 40
Joined: Fri Jun 29, 2012 3:43 pm
Location: Earth

Re: labels, when do they render HTML?

Postby dfrazier » Fri Oct 19, 2012 8:49 pm

*crickets*
This is my signature.
User avatar
dfrazier
 
Posts: 40
Joined: Fri Jun 29, 2012 3:43 pm
Location: Earth

Re: labels, when do they render HTML?

Postby ROCLASI » Fri Oct 19, 2012 9:05 pm

Hi,

I just tested it in Servoy 6.1 and it works fine for me.
Can you show how you set your label and what does the HTML look like ?
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: labels, when do they render HTML?

Postby dfrazier » Fri Oct 19, 2012 10:22 pm

After performing some more investigating, it appears that SOME of the tags continue to work. Not all of them though. See my code below:

Code: Select all
var labelDP = "<html><div style='width:50%;'>abcdefghijklmnopqrstuvwxyz 0123456789 <br />abcdefghijklmnopqrstuvwxyz 0123456789 abcdefghijklmnopqrstuvwxyz 0123456789 <br />abcdefghijklmnopqrstuvwxyz 0123456789 abcdefghijklmnopqrstuvwxyz 0123456789 abcdefghijklmnopqrstuvwxyz 0123456789 </div></html>"

function onLoad(event)
{
   elements.label3.text = labelDP
}


So in my project I have 3 labels. The first one has the contents of the labelDP variable literally copied and pasted into the text property in the designer. The second label uses labelDP as its dataprovider. The third label relies on the onLoad function to change the text property of the label with javascript. Since all 3 labels have the exact same html string, I would think they would all render identically. They do not. On labels 2 and 3, the div tag width is ignored. Also, text does not wrap. Label 1 will render div tag width properly, and will also wrap text even if a div tag is not used.

The whole reason I want this to work is to automatically wrap text.
Attachments
labelHTMLRender.servoy
This is the project I am referring to in my post.
(4.27 KiB) Downloaded 275 times
This is my signature.
User avatar
dfrazier
 
Posts: 40
Joined: Fri Jun 29, 2012 3:43 pm
Location: Earth

Re: labels, when do they render HTML?

Postby dfrazier » Tue Oct 23, 2012 3:21 pm

I wrote up this bug report for this issue: https://support.servoy.com/browse/SVY-3279
This is my signature.
User avatar
dfrazier
 
Posts: 40
Joined: Fri Jun 29, 2012 3:43 pm
Location: Earth


Return to Forms

Who is online

Users browsing this forum: No registered users and 25 guests