Defining Property Overrides

Description

Web publishing applications only. Web components have many properties, which you set in the grid, dialog, and other component builders. After you place a component on an A5W page, you will find a property override section for it in the source of the page. The code below shows a piece of an A5W page which contains a grid component named Invoices.

<html>
<head>
<%a5
Delete tmpl_Invoices
DIM tmpl_Invoices as P
tmpl_Invoices = a5w_load_component("Invoices")
'Following code allows you to override settings in the saved component, and specify the component alias (componentName property).
'Tip: Keep the componentName property short because this name is used in page URLs, and it will help keep the URLs short.
'Each component on a page must have a unique alias (componentName property).
with tmpl_Invoices
    componentName = "Invoices"
end with
...

The piece that is interesting is.

...
with tmpl_Invoices
    componentName = "Invoices"
end with
...

Between the with ... end with statements, you may redefine any of the Invoices grid component properties. For example.

...
with tmpl_Invoices
    componentName = "Invoices"
    DBF.filter = "userID = " + quote(session.protectedUserID)
    SearchField_Info[1].CheckBox.Filter = "userID = " + quote(session.protectedUserID)
    field_info[7].DropDownBox.Filter = "userID = " + quote(session.protectedUserID)
    QuickSearch.Radiobutton.Filter = "userID = " + quote(session.protectedUserID)
end with
...

There are two important prerequisites.

  1. You must know the exact property name and data type. See Setting Grid Properties, Setting Grid Control Properties, Setting Dialog Properties, Setting Dialog Control Properties, and Setting Update Properties.

  2. When defining expressions that filter records, list boxes, radio buttons, and check boxes, you must remember that all page variables (controls) are type character. See Filtering a Grid with a Session Variable and Filtering an ADO Grid with a Session Variable.

See Also