Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
masroorahmedkhan

Veteran
Registered:
Posts: 113
Reply with quote  #1 
hi,
I want to know when we are at stage view (open an item in ToDoList or WatchList).

the items like text boxex memo fields are all shown in gray color, it their is some setting in the .ccs files which will allow me to set color of my choice for these gray fields.



__________________
masroor
0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #2 

The gray background is because the text boxes are set to readonly when on a stage window.

However you can set the background color with client script.

I use the following function to set the style object

function ChangeStyleProperty(Object, Property, Setting)

{
try
{
if(Object.style) Object.style[Property]=Setting;
}
catch(ex)
{
// prevent error messages when attempting to set invalid style objects
// if the developer wishes to pursue why item is not being set uncomment the alert and extend as needed
//alert(ex.description);
}
}


Call it in your form load or other scripts as follows

ChangeStyleProperty(document.getElementById("myTextBox"),"backgroundColor","orange");

The style setting function will prevent the client side script from displaying errors if style element you reference has the wrong case or does not exist for the object.

__________________
Your best practice does not conform with my best practice.
0
masroorahmedkhan

Veteran
Registered:
Posts: 113
Reply with quote  #3 
hi,

i am attaching a simple procedure which will demonstrate the style sheet property to apply. But it did not work.

The BPMS version used is 7.6 SR2.

 
Attached Files
xep test_color_style_sheet.xep (1.97 KB, 11 views)


__________________
masroor

0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #4 
You are only passing the textbox name to the ChangeStyleProperty function.  You must pass the object.

So instead of
    ChangeStyleProperty ( 'Text1','backgroundColor' ,'orange')
 
for your form load call use
    ChangeStyleProperty ( document.getElementById('Text1'),'backgroundColor' ,'orange')

I built this function because so many of our client functions needed to modify style settings on the form and I got tired of repeating the error checking.


__________________
Your best practice does not conform with my best practice.
0
masroorahmedkhan

Veteran
Registered:
Posts: 113
Reply with quote  #5 
hi,
It worked fine,

only one last question can we set to this function

 ChangeStyleProperty ( document.getElementById('Text1'),'backgroundColor' ,'orange')

insted of orange can i pass RGB values + hue / sat/ lum how can i set to this function.





__________________
masroor
0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #6 
Since BPM is not using CSS3 you can't use hue/sat/lum but you can use RGB



__________________
Your best practice does not conform with my best practice.
0
masroorahmedkhan

Veteran
Registered:
Posts: 113
Reply with quote  #7 
hi,

can you please give me the syntax how to put the RGB values to this function.

__________________
masroor
0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #8 
Here are some examples (note that all examples set the background color to red)
 
// color name not rgb
    ChangeStyleProperty ( document.getElementById('Text1'),'backgroundColor' ,'red')

// short form rgb (#rgb)
    ChangeStyleProperty (document.getElementById('Text1'),'backgroundColor' ,'#F00')

// long form rgb (#rrggbb)
    ChangeStyleProperty ( document.getElementById('Text1'),'backgroundColor' ,'#FF0000')

// numeric rgb
    ChangeStyleProperty ( document.getElementById('Text1'),'backgroundColor' ,'rgb(255,0,0)')


// percent rgb
    ChangeStyleProperty ( document.getElementById('Text1'),'backgroundColor' ,'rgb(100%,0%,0%)')



W3C link for CSS2 color setting
http://www.w3.org/TR/CSS2/syndata.html#color-units

__________________
Your best practice does not conform with my best practice.
0
tspafford

Senior Member
Registered:
Posts: 64
Reply with quote  #9 
Can this be used to change the font color of button text? I'm using "Color" as that is the DOM element for text.

I added your function to a jscript

Called on form client extensions as

OnLoad=ChangeStyleProperty(document.getElementById("Button2"),"Color","white")&Language=JScript  

No change to button text color.

Thanks
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!