Adding Custom Views

There are two types of custom views related to web mode: Default Web Page and Secondary Web Page.

The Default Web Page custom view is the default page that will be shown for that type. Secondary Web Pages will only be displayed if they are linked to explicitly. You can have multiple secondary web pages, but only one default web page.

When adding a web mode custom view, you don't need to worry about the icon, or the option to 'Replace' or make the 'Default' view, as these only apply to custom views that are displayed in the regular dataview mode of WorkflowFirst applications.

Creating your custom view will work much the same way as you create regular custom views, as defined in the section on designing custom views. However, if you have a master page defined, then your custom view HTML will appear embedded within the master page.

Also, the following DbfScript functions are specific to web mode:

GetVariable(var)

The GetVariable function allows you to retrieve the value of variables in your DbfScript namespace, and also parameters that are passed into the URL. This can be useful to pass information such as the id of a secondary record to view, for example. This means that if your URL is /default.aspx?id=12, then running GetVariable("id") will return 12.

GetFormHtml(path, returnUrl)

This function allows you to insert the HTML to generate the form tag for updating or inserting data into a part of the database. The data to update is specified in the path variable (which should be something like &path), and returnUrl specifies the URL that the user will be returned to once the form is submitted.

All fields to include in the form must have a 'name' attribute set that matches the name of the field in the record. You're also responsible for adding a submit button.

GetFormHtmlForAction(path, actionName, isGlobal, returnUrl)

This also returns the HTML for the form tag, but rather than for inserting or updating a part of the database, this is rather for running an action that is defined at that location in the database. For a global action, you can pass in Nothing() for the path, and set isGlobal to true.

GetUser()

This function returns the UserArea record of the currently logged-in user. You can use this test whether the user is a guest, for example.

GetUserExtendedField(field)

This function returns the value of 'field' in the UserArea of the currently logged-in user. For example, you may put a section in your HTML such as:

$=(GetUserExtendedField("UserID")!="Guest")$
 You must login to continue
 $end:CheckForGuest$
 

 ...which will only display the request for them to login if they are currently a guest user.


Next Topic:
v4.2.0.956 (beta)
Up Since 2/29/2024 12:02:23 AM