Settings for adding user-defined HTML syntax and hyperlinks to controls in a Web DataWindow.
Column, Computed Field, Picture, and Text controls
PowerBuilder dot notation:
dw_control.Object.controlname.HTML.property
Describe and Modify argument:
"controlname.HTML.property { = ' value ' }"
Parameter |
Description |
---|---|
controlname |
The name of the control whose HTML properties you want to get or set. |
property |
A property for generating HTML syntax and hyperlinks in a Web DataWindow. Properties and their values are listed in the table below. |
value |
The value to be assigned to the property. Value can be a quoted DataWindow expression only where noted. |
Property for HTML |
Value |
---|---|
AppendedHTML |
HTML you want to append to the generated syntax for the rendering of a DataWindow control before the closing bracket of the HTML element for that control. |
Link |
(exp) A URL that is the target of a link (HTML anchor element) generated for each data item in the column or for the specified control. The text or user-visible part of the link will be the data value in the column, the value of the computed field, the text in the Text control, or the image of a Picture control. The URL can include parameters. Other properties, such as LinkArgs, can cause additional parameters to be added when the HTML is generated. |
LinkArgs |
A string in the form: argname='exp'{ | argname = 'exp' } ...
Argname is a page parameter to be passed to the server. Exp is a DataWindow expression whose value is a string. It is evaluated and converted using URL encoding and included in the linkargs string. The evaluated LinkArgs string is appended to the HTML.Link property when HTML is generated to produce a hyperlink for each data item in a column or other DataWindow control. |
LinkTarget |
(exp) The name of a target frame or window for the hyperlink (HTML A element) specified in the Link property. The target is included using the TARGET attribute. You can use the LinkTarget property to direct the new page to a detail window or frame in a master/detail page design. If LinkTarget is null or an empty string (“”), then no TARGET attribute is generated. |
ValueIsHTML (does not apply to Picture controls) |
(exp) A boolean that, if true, allows the control contents (data value in a read-only column, the value of a computed field that is not calculated on the client, or the text in a Text control) to be generated as HTML. For XHTML, the control contents must be well-formed XHTML. |
The Link properties are typically used to create master/detail Web pages where a link on a data item jumps to a detail DataWindow for that item. LinkArgs is used to pass a retrieval argument identifying the particular item.
The AppendedHTML property is used to specify attributes and event actions to add to the HTML rendered for Web DataWindow controls.
The ValueIsHTML property allows you to include standalone HTML syntax or tags in the generated Web DataWindow. You can use this feature to add horizontal rules (<HR>) and anchor tags (<A HREF="home.htm">home</A>) to Web DataWindows. If you add row-specific anchor tags, you can use the Modify method or DataWindow expressions to generate conditional HTML for each row.
The HTML generator does not validate the HTML you append to or include in controls in DataWindow objects. If the HTML is invalid, the DataWindow might not display correctly. You must also be careful not to append an event name that is already generated for the control as a coded client-side event.
Select the control and set the value in the Properties view, HTML tab.
// EMPID and PAGE are page parameters for the
// page server’s session object
dw1.Object.empid.HTML.Link = "empform.html"
dw1.Object.empid.HTML.LinkArgs = "EMPID = ’empid’"
dw1.Object.empid.HTML.LinkTarget = "detail_win"
dw1.Object.empid.HTML.ValueIsHTML = "true"
dw1.Object.helpicon.HTML.Link = "help.html"
dw1.Object.helpicon.LinkArgs = "PAGE = ’empform’"
setting = dw1.Describe("DataWindow.HTML.Link") dw1.Modify("empid.HTML.Link = 'empform.html'")