Genpact Cora Knowledge Center

Support

Create a Page Using the FormViewer Control

The following procedure shows how to: 

  • Add a Form Viewer control that loads a custom Cora Orchestration view within an aspx page.
  • Add a custom menu item transformation.

In the example, you want to add a new menu item named "My Form,"  which opens a new tab in the portal.


Before you begin

  • Make sure that you have created the new aspx file. In this example, it is called MyForm.aspx.

Example of the MyForm.aspx markup

<%@ Page Title="My Form" ResourceTitle="MyForm" Language="C#" AutoEventWireup="false" EnableViewState="false" CodeBehind="Default.aspx.cs" Inherits="PNMsoft.Sequence.Runtime.Web.UI.Pages.Default, PNMsoft.Sequence.Runtime.Web.UI, Version=10.0.0.0, Culture=neutral, PublicKeyToken=0a1a1b90c1c5dca1" %>
<%@ Register TagPrefix="sq" TagName="FormViewerControl"  Src="~/_controltemplates/Flowtime/FormViewerControl.ascx" %> 
<asp:Content ID="Content" ContentPlaceHolderID="content" runat="server">     <div class="sqpt-container"> 
<div class="sqpt-grid-control"> 
    <sq:FormViewerControl ID="ReportsView" FormVirtualPath="~/SequenceForms/wf/WFSpace/WFName/FormName/ViewName.ascx" runat="server" /> 
</div> 
</asp:Content>

Procedure

  1. In the project template, add the MyForm.aspx file at /src/addons/aspnet/pages in the required hierarchy.
    Graphical user interface, application

Description automatically generated
  2. /src/addons/transform, add the menu item that will open the page.
    Remember to keep the required folder hierarchy.
<?xml version="1.0"?>
<CommandDocument xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xmlns="http://schemas.pnmsoft.com/sequence/2013/01/ui/commands">
    <CommandTable xdt:Transform="InsertIfMissing">
        <NavigateToUrlCommand xdt:Transform="InsertIfMissing" xdt:Locator="Match(Id)" Id="MyFormCommand" Url="~/MyForms/MyForm.aspx"/>
    </CommandTable>
    <ControlTable xdt:Transform="InsertIfMissing">
        <Menu xdt:Transform="InsertIfMissing" xdt:Locator="Match(Id)" Id="Portal">
            <Items>
                <MenuItem xdt:Transform="InsertIfMissing" xdt:Locator="Match(Id)" Id="MyFormMenuItem" Command="MyFormCommand" Text="My Form" Tab="true"/>
            </Items>
        </Menu>
    </ControlTable>
</CommandDocument>

NOTE
Mark Tab=”true” to ensure that the page opens on a portal tab.

Check that the configuration transformation has taken place

Check out the markup at
C:\inetpub\wwwroot\Cora SeQuence\Flowtime 1\Shared Resources\Components\Flowtime\Config\Portal\Commands\Default.config
 

Make sure that transformation was applied to your XML, and the new menu item was added to the default menu items.


Watch a video to learn how to apply common customization scenarios.