[Logo] Serotonin Software Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: shriniarole
Forum Index » Profile for shriniarole » Messages posted by shriniarole
Author Message
Ah! Got it to work. Stupid mistake. I add a comment to the CSS before my declaration and used the hash mark (too much shell scripting lately) rather than the /* */ comment... Once I changed that, it works great.

In case anyone else wants to do, here is what I did:

common.css as following lines:
/* custom CSS -- S. Arole. */
.PCMSBox {
height: 70px;
width: 70px;
border: 2px solid orange;
background-color: yellow;
text-align:center;
font-size: 20px;
font-weight: bold;
}

and the server-side script tag has the following:
mytxt='<div class="PCMSBox">'
mytxt+=htmlText
mytxt+='</div>'
return mytxt

Thanks!
I got the effect I needed.. but not through the common.cs

I discovered that if I had a server-side script on the view that had a style definition in it, I could use that definition in any html/script tag on the view. So -- I just created a placeholder server side script to hold the css and used those style defs in the other points..

I'd still prefer to use common.cs though -- so I'll play with that some more. So far, no luck though.
Any plan/way to read/write from/to OPC datasource?
In order to format the view effectively, I am using a server-side script as follows:
mytxt='<style type="text/css">.PCMSBox {'
mytxt+='height: 70px;'
mytxt+='width: 70px;'
mytxt+='border: 2px solid orange;'
mytxt+='background-color: yellow;'
mytxt+='text-align:center;'
mytxt+=' font-size: 20px;'
mytxt+=' font-weight: bold;'
mytxt+='}</style>'
mytxt+='<div class="PCMSBox">'
mytxt+=htmlText
mytxt+='</div>'
return mytxt

This formats the point value into a 70x70 box for display. Is there any way to put the CSS style declaration in a file so that it is available client side? This way, if I decide to change the border from orange to green, for example, I wouldn't have to change the script for each point, but rather just change 1 css definition. I tried to add to common.css and include the css in the html script, but it did not work for some reason.
 
Forum Index » Profile for shriniarole » Messages posted by shriniarole
Go to:   
Powered by JForum 2.1.9 © JForum Team