HOW TO : How to add html code in servoy

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

HOW TO : How to add html code in servoy

Postby amchtwe » Wed Oct 07, 2009 12:14 pm

Hi there,

I want to add some HTML code in my servoy project.

I tried to add HTML code in label object (named lblHTML) like

var html = "<html><table><tr><td>some text here</td></tr></table></html>";

forms.testForm.lblHTML.Text = html;

but i guess it is not a good idea to add HTML sort like that.

Next, I tried HTML pane to add HTML code.

But actually I've no idea with HTML pane.

Could you pls show me how to do with HTML pane??


Thanks indeed

Aung Mon
You see things; and you say "Why?"
But I dream things that never were; and I say "Why not?"
amchtwe
 
Posts: 32
Joined: Wed Feb 06, 2008 7:46 am
Location: BKK

Re: HOW TO : How to add html code in servoy

Postby mboegem » Wed Oct 07, 2009 12:20 pm

amchtwe wrote:forms.testForm.lblHTML.Text = html;


This should actually be:
Code: Select all
forms.testForm.elements.lblHTML.text = html;


Hope this helps!
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1748
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: HOW TO : How to add html code in servoy

Postby amchtwe » Wed Oct 07, 2009 12:34 pm

Hi mboegem,

Thanks for your reply.

i tried like what you said "forms.testForm.elements.lblHTML.Text = html;"

but u know, label object is not very good to show html in the servoy, i guessed.

it can only show limited area and if my data in the html area is dynamically grow then it can't show he entire html are.

I want to use some other object rather than HTML code inside label object.
You see things; and you say "Why?"
But I dream things that never were; and I say "Why not?"
amchtwe
 
Posts: 32
Joined: Wed Feb 06, 2008 7:46 am
Location: BKK

Re: HOW TO : How to add html code in servoy

Postby mboegem » Wed Oct 07, 2009 12:56 pm

try a html-area when using global- or form variable.
This should give a better result.

Generally: the standard display options of html within java are not of the most brilliant kind, so you'll find some restriction on what is possible.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1748
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to How To

Who is online

Users browsing this forum: No registered users and 2 guests

cron