Bookshelf Home | Contents | Index | PDF |
Configuring Siebel Business Applications > Configuring Siebel Web Templates and Siebel Tags > Configuring an HTML Control Type > Configuring an HTML TypeThis topic describes examples of configuring an HTML type. Configuring an HTML Type for a ControlThe following example code creates a custom HTML type for the LabelRed control that displays the caption of the control in red: <swe:htmltype name="LabelRed"> <font color="red"> <swe:this property="DisplayName"/> </font> Configuring an HTML Type for an Applet ModeYou use the Mode attribute of the swe:htmltype tag to define a custom format for the Base, Edit, New, and Query applet modes. If you define a mode, then the Siebel Web Engine uses the format you define only if the current show mode matches the value defined for this attribute. For example, assume you create a new HTML type named SiebelText to display a control that Siebel CRM displays in the following ways: In this example, you use the following code: <swe:htmltype name="SiebelText"> <swe:this property="Data" type="Text"/> <swe:htmltype name="SiebelText" mode="Edit"> <swe:this property="DisplayName"/>: <swe:this property="Data" type="Text"/> For more information, see Options to Control How the User Creates, Edits, Queries, and Deletes CRM Data. Configuring an HTML Type when Siebel CRM Cannot Call a MethodTo display a different image depending on the state of a control or list column, you can define an optional attribute of the swe:htmltype tag, such as State. You can use the following states:
For example, to display a gray button when Siebel CRM cannot call a method, add the following code in addition to the default definition described earlier in this topic: <swe:htmltype name="MiniButton" state="Disabled"> <img src="images/graybtn_left.gif" border=0 height=15 width=2> <swe:this property="Data" type="Link" /> <img src="images/graybtn_right.gif" border=0 height=15 width=2> Note how Siebel CRM handles calls differently:
If Siebel CRM cannot call a method, then you can use a custom HTML type to hide a control or list column. For example, you can create the following empty swe:htmltype tag for the Disabled state:
This code hides only the swe:control tag or the swe:this tag that calls the FormattedHtml property. Configuring an HTML Type to Indicate a Required FieldTo display the SiebelText type with an asterisk (*) to indicate a required field, you can add the following example code in addition to the definitions for this type described earlier in this topic: <swe:htmltype name="SiebelText" mode="Edit" state="Required"> <swe:this property="DisplayName"/> <swe:this property="Data" type="Text"/> The Siebel Web Engine uses the following order of precedence when it looks up HTML Type definitions in the SWF file: It is recommended that you always create a default format definition for all custom HTML types. To create a default format definition, you define it without specifying the mode attribute and state attribute. Using the Data Property of the SWE This TagThe Data property of the swe:this is similar to a macro that casts the current, custom type to one of the intrinsic types, then inserts the FormattedHtml property of the intrinsic type. To use the Data property, you add a Type attribute to the swe:this tag. This Type attribute names the intrinsic type. For example, use the following code to create a new type named MiniButton. This code adds a special format to the Web Engine intrinsic type named Link: <swe:htmltype name="MiniButton"> <img SRC="images/btn_left.gif" border=0 height=15 width=2> <swe:this property="Data" type="Link" /> <img src="images/btn_right.gif" border=0 height=15 width=2> The following code outputs the same HTML as if the template included a separate swe:this tag, where the property is FormattedHtml and the HTML type of the control is the predefined Link type: swe:this property="Data" type="Link" You can only define a predefined type and not a custom type for the type attribute of a Data element. |
Configuring Siebel Business Applications | Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |