|
GEN:FieldValue tags can be easily made to open a browser in a new window
when clicked. The following example uses a FieldValue tag to open an Edit
Record page in a new browser.
|
<a href='<GEN:FIELDVALUE NAME="FieldOne"/>' target=”_blank”>
<GEN:FIELDVALUE NAME="FieldTwo"/>
</a>
|
The target attribute specifies that a new browser window is to be opened.
Any target name may be used.
The FieldOne code generation tag is bound to a database field containing the
linked URL used by the <a href> HTML tag. The user will be redirected
here when the link is clicked. Note that the href attribute must use single
quotes to encapsulate the linked URL since the GEN:FieldValue code generation
tag requires that double quotes be used for its Name attribute.
The FieldTwo code generation tag is what is displayed to the user. You can place
as many data-bound GEN:FieldValue code generation tags within the <a href> tag as
you desire. For example, you could display an entire name and address block as a
hypertext link:
<a href='<GEN:FIELDVALUE NAME="CustomerURL"/>' target=”_blank”>
<GEN:FIELDVALUE NAME="FirstName"/> <GEN:FIELDVALUE NAME="LastName"/>
<GEN:FIELDVALUE NAME="Address"/>
<GEN:FIELDVALUE NAME="City"/>, <GEN:FIELDVALUE NAME="State"/> <GEN:FIELDVALUE
NAME="Zip"/>
Customer since <GEN:FIELDVALUE NAME="CustomerDate"/>
</a>
|
You may also include text and other HTML within the <a href> tag.
If your database does not have a field containing the URL, then you can
compose the URL using GEN:FieldValue code generation tags within the <a href>
tag, e.g:
<a href='../Customers/EditCustomersRecord.aspx?CustomerID=<GEN:FIELDVALUE NAME="CustomerID"/>'
target=”_blank”>
<GEN:FIELDVALUE NAME="CustomerName"/>
</a>
|
Use this procedure to bind the code generation tags to their appropriate
database fields:
Step 1: Place the above HTML, including <a href> tag and GEN:FieldValue
code generation tag(s) in your HTML layout page.
Step 2: In Iron Speed Designer, display the the Page Properties dialog for the
page (Tools, Page Properties…). Click the Show Tree button to display all the GEN: code
generation tags on the page, and navigate to the newly placed tags: FieldOne, FieldTwo, etc.
You may need to expand the tree nodes to see them.
Step 3: In the Display tab, select Literal as the Display Option for each of the
newly placed tags. Make sure the field is Visible in the Display Style area.
Step 4: In the Bindings tab, select the database table name and field name for each
of the newly placed tags, e.g.:
| Tag Property |
Setting |
| Code Generation Tag |
FieldOne |
| Display Style |
Literal |
| Table |
Customers |
| Field |
CustomerURL |
This example assumes the CustomerURL field contains the URL.
| Tag Property |
Setting |
| Code Generation Tag |
FieldTwo |
| Display Style |
Literal |
| Table |
Customers |
| Field |
CustomerName |
Step 5: Build and run your application.
|