How to add external CSS and JS files to servoy application

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

How to add external CSS and JS files to servoy application

Postby pradiptab » Mon Apr 27, 2009 7:21 am

Hello

I want to add some .css and .js files with my servoy web application.
Here i cannot see any html, body or head tags. So I dont know how to add these external files to my application.
Is it possible in servoy ? If yes, then please tell me the trics to do the same.

Thanks
Pradeep
Pradipta
Mindfire Solutions
SAN Developer | Servoy Certified Developer
pradiptab
 
Posts: 59
Joined: Tue Mar 10, 2009 2:32 pm
Location: India, Orissa, Bhubaneswar

Re: How to add external CSS and JS files to servoy application

Postby Joas » Mon Apr 27, 2009 7:33 am

To do that, put an htmlarea on your form and in a onLoad method do something like:
Code: Select all
   globals.myHTML = "<html><head><style type='text/css'>\
                  #test {\
                     position: absolute;\
                     top: 30px;\
                  }\
                  </style></head>/html>"
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: How to add external CSS and JS files to servoy application

Postby martinh » Mon Apr 27, 2009 9:20 am

Joas,

This is what Bob Cusick wrote about webclient development:

bcusick wrote:
9. When displaying HTML in a HTML area - DO NOT use your own <style></style> tags in the HTML - in WC it will render incorrectly. Just use <HTML> for WC HTML areas - and the style of the label/field will determine the overall font/size



Do not use your own <style> tags and you say here that is can be used.
Can it be used now?

Martin
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: How to add external CSS and JS files to servoy application

Postby bobcusick » Fri May 01, 2009 6:32 pm

That was an old post with an older version of Servoy and an older version of Java.

Using Servoy 4.1.2 - you can put in your own style tags - but just be aware that the FONT attribute will inherit directly from the style of the field ON THE FORM.

Hope this helps!
User avatar
bobcusick
 
Posts: 126
Joined: Mon Jan 12, 2009 9:13 pm


Return to How To

Who is online

Users browsing this forum: No registered users and 9 guests

cron