Link Block Code Samples
Links can be used in a variety of locations on a page. In the client, they are typically shaded blue to indicate the presence of a link.
You can include a link to another page for the column attribute of a chart block. If a parameter is included on the target page, the selected value is passed to the target page.
For bar, H-Bar, and line charts, the links are accessible through the chart values. For pie charts, the links are accessible through the legend and chart values.
For example:
bar column = "Net Sales" {
link {
page id = "target"
}
}
It is a best practice to include a page identifier with a DivePort link. For example:
link {
diveport {
url "https://bridge.dimins.com/framework"
page "a0311"
}
}
Here is an example of a DivePort link without a page identifier.
link {
diveport {
url "https://bridge.dimins.com/framework#page=current_overview"
}
}
You can use a link to open collateral that is stored in a document repository. For example, this link allows the user to open the specified pdf file within DiveTab.
link {
document {
repository "divetabdocs"
path "di-program-advisor-data-sheet.pdf"
}
}
Assuming the project structure includes a folder called orders and the column MyOrder in the cBase or cPlan is populated with string data for the filename located in the document repository, the following example creates a link to open the document.
link {
document {
repository "orders"
path column = "MyOrder"
}
}
A link with a map reference passes the data from the indicated column to Google Maps. The data can be zip codes, postal codes, street addresses, or latitude and longitude coordinates. In this example, Map Link is a column in a cBase populated with data appropriate to use for mapping.
link {
map column = "Map Link"
}
Here is another example using Combined Address.
grid {
row "Address:" {
text column = "Address1" {
link {
map column = "Combined Address"
}
}
}
}
Page links allow DiveTab users to navigate to other data pages.
elements {
pie-chart id = "pie" {
dimension "Manager"
title "Manager"
column column = "Cases YTD" {
link {
page id = "overview_mgr"
}
}
}
}
Here is another example of a page link.
row {
text column = "Production Category Count" {
link {
page id = "rp-productioncategory"
}
}
}
You can set a parameter to pass information from that page to the linked page. For example, when this link is activated, the Type parameter with a value of Account Sold is passed to the report-as-ytd page.
link {
page id = "report-as-ytd"
parameter "Type" "Account Sold"
}
Web page links can open a browser within DiveTab to a specified website.
link {
web-page "http://www.dimins.com"
}
Assuming there is a wiki_site column in the cBase that is populated with appropriate URLs (for example, http://en.wikipedia.org/wiki/Acura_RLX), the following snippet opens the web page.
text "Wikipedia Site" {
link {
web-page column = "wiki_site"
}
}
Web page links can also open the default email program. Assuming appropriate configuration to the Email Link column (for example, mailto:[email protected]), the following example opens a web page that signals the default email program to open.
text "E-mail" column = "Email" {
link {
web-page column = "Email Link"
}
}
See also: