About the Author

Saturday, 16 March 2013

Changing Styles



Are you bored of using with the same set of styles and colors every day? You can do a lot in peoplesoft to completely revamp the appearance of the application. You can change the style of the entire application, create new styles and change the styles of the page elements dynamically through peoplecode.

I will try to throw some light on it so that you will get a point to start with.

It will be worth of writing two sentences about style sheets. Style sheets are basically a set which stores different style classes. Each style class will have its own property such as font, color, size, back ground color and so on. Once you create a style sheet, you can attach the styles to any number of objects so that the style is applied to the object you attached with.


By default Peoplesoft will deliver a few styles along with the application. To change the entire theme or styles of the application navigate to the link: People Tools > Utilities > Administration > People Tools Options
Here you can change the styles by changing the value in the field “Style Sheet Name”. Once you log out and log in back, you can see the change. Sometimes you may need to clear the web server and browser cache to see the changes work properly.

To create your own styles, open the application designer and click on File > New; and select Style Sheet. Now to simplify your life, select standard style sheet. If you know css then you can select the other options also.
From the free form object double click the parent node and double click again on the object to see the final list of object like edit box hyper link etc… Now to define your style, double click on the object and make the changes similar to what you do in old MS Word. Save it and you are done with your style.


Now I will talk about one more section to let you know how to dynamically change the style of an object by people code. The PeopleSoft Field objects have an associated property with it called style. You can use this property to set the style of the object.

&fField = GetRectrd(Record.MY_REC).GetField(Field.MY_FLD);
/* Seeting the style to editbox error */
&fField.Style = “PSERROR”;

The style you mention must be defined inside the style sheet you selected for the page. The default styles for any object can be found in the object properties box (Alt+Enter).

I will use the most frequently quoted example to set the style dynamically.


&fField = GetRectrd(Record.MY_REC).GetField(Field.MY_FLD);

/* Check if value is there */
If None(&fField.Value) Then

/* If no value then highlight the field in red and throw error. */
&fField.Style = “PSERROR”;
Error “Value is required for the field …”;

Else
/* Change back the field to normal editbox style */
&fField.Style = “PSEDITBOX”;
End-If;

1 comment:

  1. Hello, Is there a way in fluid to temporarily highlight fields for a few seconds?
    Example: If a user changes a field and the fieldchange event fires code that changes other fields on the page, I would like to highlight those other changed fields only with a chosen color so the user has awareness.

    ReplyDelete

Note: only a member of this blog may post a comment.