Skip to content

pbAllowHtml - cWebColumn

Determines whether the column value applies embedded HTML or whether it is HTML encoded

Type: Property
Access: Read/Write
Data Type: Boolean
Parameters: None

Syntax

{ WebProperty=Client }
Property Boolean pbAllowHtml
Access Type Syntax
Read Access: WebGet pbAllowHtml to BooleanVariable
Write Access: WebSet pbAllowHtml to BooleanVariable/Value

Description

Normally, the framework HTML encodes the psValue text that is displayed in a column so that any characters within the value that might be interpreted as HTML by the browser are displayed literally and not interpreted as HTML.

This HTML encoding is normally what you want, as embedded HTML characters are normally present by chance and you do not intend the browser to do anything other than display the characters.

Sometimes you may have a special reason to embed HTML inside the column's value. Set pbAllowHtml to True to disable HTML encoding of the column values.

Warning: If you use this feature, you should understand the element structure of framework lists and grids and also the way that system and theme CSS is applied.

Using embedded HTML should be a technique of last resort. If you need to apply special column styling, then it is better to use the provided properties or create and apply styles using CSS, for example by adding a style to the workspaces application.css file.

Embedded HTML that is generated by your DataFlex objects is considered poor separation of client and server side elements.

Note: Set pbEnabled to False for any column that uses embedded HTML. The framework does not support editable columns containing embedded HTML.

Sample

The example below demonstrates how to use embedded HTML in a column that displays the customer credit limit in italics, but the "$" dollar sign is not in italics. A element is wrapped around the credit limit value that uses an embedded style.

Object oCalculated is a cWebColumn
    Set piWidth to 6
    Set psCaption to "Value"
    Set pbEnabled to False
    Set pbAllowHtml to True

    Procedure OnSetCalculatedValue String ByRef sValue
        Move ('$<span style="font-style:italic;">' + String(Customer.Credit_Limit) + '</span>') to sValue
    End_Procedure
End_Object

A better engineered way to achieve the special styling shown above would be to apply a class attribute to the element and then style the class using CSS in your application.css file.

About Web Properties

Each web property maintains two values: The regular property value is set during object creation and should not be changed during the lifetime of that object. To access that value, use the standard property Get and Set syntax.

The web property value is the local value stored at each client. This is synchronized to the client's local value whenever a server call is being processed. To access the web property value, use the WebGet and WebSet syntax above instead of the standard Get and Set syntax.

About Web Properties

Each web property maintains two values: The regular property value is set during object creation and should not be changed during the lifetime of that object. To access that value, use the standard property Get and Set syntax.

The web property value is the local value stored at each client. This is synchronized to the client's local value whenever a server call is being processed. To access the web property value, use the WebGet and WebSet syntax above instead of the standard Get and Set syntax.