Using CSS to Customize the Rendering of a Form Control
TIBCO Business Studio Forms supports the use of Cascading Style Sheets (CSS) for customizing how form controls are rendered. You can use CSS with Business Studio Forms to apply styling to a form control.
Sample Project
To view the sample for this task, import the advanced sample projects as described in Importing the Forms Advanced Samples. The sample form and CSS file for the task described in this section are contained in the forms.samples.layout sample project.
- The form (ControlRendering.form) is at:
forms.samples.layout/Forms/CSS Samples/ControlRendering/
- The CSS file (ControlRendering.css) is at:
forms.samples.layout/Presentation Resources/css/
You can double-click the form and CSS filenames (as well as those of other project resources) in the Project Explorer to open them in the editor. There, you can examine their contents and use them as models for your own projects.
Explanation
This task covers the case where you want to apply special styling to a specific control in a form.
In order to design the rendering of a control, it is useful to know how the control is rendered in the browser. TIBCO Forms makes use of CSS classes attached to the HTML DOM nodes in order to control rendering. Generally, it is not necessary to know which actual HTML elements are being used in the rendering, and as a practice you should try to use only the CSS classes in devising CSS selectors in your stylesheets, as this approach is the most portable across different target platforms.
Shown here is a representation of the CSS classes that are used to render a control, and their relationship to one another within the nested DOM:
—component, customclass —label —container —control —hint
See Reference for a detailed description of the CSS classes used in rendering forms.
The customclass is the name of a CSS class specified in the design time model.
Procedure
.highlight .label, { color: #FF0000; font-family: Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
The CSS selector used here is .highlight .label. This is used for clients that use GWT, which is the rendering used in AMX BPM Openspace and Workspace.