Table of Contents

Class LayoutBuilderBaseClass

Namespace
Contensive.BaseClasses.LayoutBuilder
Assembly
CPBase.dll

LayoutBuilders create the html for common Admin UI cases. This class has 2 uses.

  • the base class provides an api that client apps use to create admin layouts
  • child classes implement these api calls, and also provide non-override properties used in the mustache viewModels that populate layouts.

They must be implemented 2 ways, first called by the page during the initial page load, and second called by the ajax refresh methods. Both methods return the exact same html, but the javascript that calls the ajax methods selectively replaces the important content.

public abstract class LayoutBuilderBaseClass
Inheritance
LayoutBuilderBaseClass
Derived
Inherited Members

Constructors

LayoutBuilderBaseClass(CPBaseClass)

LayoutBuilders create the html for common Admin UI cases. This class has 2 uses.

  • the base class provides an api that client apps use to create admin layouts
  • child classes implement these api calls, and also provide non-override properties used in the mustache viewModels that populate layouts.

They must be implemented 2 ways, first called by the page during the initial page load, and second called by the ajax refresh methods. Both methods return the exact same html, but the javascript that calls the ajax methods selectively replaces the important content.

protected LayoutBuilderBaseClass(CPBaseClass cp)

Parameters

cp CPBaseClass

Properties

allowDownloadButton

set to true to display the download button. If the user clicks the download button, an ajax request is made that sets LayoutBuilder.requestDownload true and calls the derived class (your code that inherits this class). The addon that calls the layoutbulder should detect requestDownload. If false, return the normal form. If true return the download data instead of the html for the addon.

public abstract bool allowDownloadButton { get; set; }

Property Value

bool

baseAjaxUrl

LayoutBuilder layouts require html page redraw with an ajax method. Set this to the url of the ajax method that returns the html for the form.

[Obsolete("Deprecated. For the system to call this addon during an ajax filter instead set callbackAddonGuid to the guid of the addon.", false)]
public abstract string baseAjaxUrl { get; set; }

Property Value

string

baseUrl

deprecated. Instead use cp.adminUI.getPortalFeatureLink()

[Obsolete("deprecated. Instead use cp.adminUI.getPortalFeatureLink()", false)]
public abstract string baseUrl { get; }

Property Value

string

blockFormTag

if true, the optional form tag will be blocked. The form tag is added automaatically if buttons, hiddens or a form-action is added

[Obsolete("Deprecated. To prevent the form tag set includeForm=false.", false)]
public abstract bool blockFormTag { get; set; }

Property Value

bool

body

The body of the layout.

public abstract string body { get; set; }

Property Value

string

callbackAddonGuid

The guid of the addon to be called to update pagination or search. Typically the same remote that calls the layout builder.

public abstract string callbackAddonGuid { get; set; }

Property Value

string

cp

public CPBaseClass cp { get; set; }

Property Value

CPBaseClass

csvDownloadFilename

A virtual filename to a download of the report data. Leave blank to prevent download file

[Obsolete("Deprecated. To create a download set .allowDownloadButton=true. Then monitor .downloadRequest and if tue return the download data. If downloadRequest is false, call getHtml().", false)]
public abstract string csvDownloadFilename { get; set; }

Property Value

string

description

simple description text. Will be wrapped in an html paragraph tag.

public abstract string description { get; set; }

Property Value

string

failMessage

message displayed as a fail message. Data is wrong

public abstract string failMessage { get; set; }

Property Value

string

deprecated. Use htmlAfterBody instead

[Obsolete("Deprecated. Use htmlAfterBody instead", false)]
public abstract string footer { get; set; }

Property Value

string

formActionQueryString

The action attribute of the form element that wraps the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

[Obsolete("Deprecated. No longer needed.", false)]
public abstract string formActionQueryString { get; set; }

Property Value

string

formid

deprecated. Use warningMessage instead

[Obsolete("Deprecated. Use addFormHidden instead", false)]
public abstract string formid { get; set; }

Property Value

string

htmlAfterBody

An html block added below the Body. Typically used for filters.

public abstract string htmlAfterBody { get; set; }

Property Value

string

htmlBeforeBody

An html block added above the Body. Typically used for filters.

public abstract string htmlBeforeBody { get; set; }

Property Value

string

htmlLeftOfBody

An html block added to the left of the Body. Typically used for filters.

public abstract string htmlLeftOfBody { get; set; }

Property Value

string

includeBodyColor

if true, the container between the button rows will include the default background color. Else it is transparent.

public abstract bool includeBodyColor { get; set; }

Property Value

bool

includeBodyPadding

if true, the container between the button rows will include default padding

public abstract bool includeBodyPadding { get; set; }

Property Value

bool

includeForm

Include a form tag around the layout. Default is true. Set false to block the form tag.

public abstract bool includeForm { get; set; }

Property Value

bool

infoMessage

message displayed as an informational message. Nothing is wrong, but the user should know

public abstract string infoMessage { get; set; }

Property Value

string

isOuterContainer

if true, this layoutBuilder will not be contained in other layoutBuilder content. This is used by the default getHtml() to include an outer div with the htmlId "afw", and the styles and javascript

public abstract bool isOuterContainer { get; set; }

Property Value

bool

javascript

The default Layoutbuilder script. Override to customize.

[Obsolete("move javascript and styles to layouts", false)]
public abstract string javascript { get; }

Property Value

string

portalSubNavTitle

[Obsolete("Use portalSubNavTitleList instead. Deprecated.", false)]
public abstract string portalSubNavTitle { get; set; }

Property Value

string

portalSubNavTitleList

Optional. If set, this value will populate the title in the subnav of the portalbuilder.

public abstract List<string> portalSubNavTitleList { get; set; }

Property Value

List<string>

refreshQueryString

Include all nameValue pairs required to refresh the page if someone clicks on a header. For example, if there is a filter dateTo that is not empty, add dateTo=1/1/2000 to the RQS

[Obsolete("Deprecated. No longer needed.", false)]
public abstract string refreshQueryString { get; set; }

Property Value

string

requestDownload

if the addon sets allowDownloadButton true, then it should monitor this property and return the download data if true.

public abstract bool requestDownload { get; }

Property Value

bool

styleSheet

The default Layoutbuilder styles. Override to customize.

[Obsolete("move javascript and styles to layouts", false)]
public abstract string styleSheet { get; }

Property Value

string

successMessage

message displayed as a success message.

public abstract string successMessage { get; set; }

Property Value

string

title

The headline at the top of the form

public abstract string title { get; set; }

Property Value

string

warning

deprecated. Use warningMessage instead

[Obsolete("Deprecated. Use warningMessage instead", false)]
public abstract string warning { get; set; }

Property Value

string

warningMessage

message displayed as a warning message. Not an error, but an issue of some type

public abstract string warningMessage { get; set; }

Property Value

string

Methods

addActiveFilter(string, string, string)

add a clickable button to the UI that will remove a filter from the active filters list.

public abstract void addActiveFilter(string caption, string removeFilterRequestName, string requestNameToClear)

Parameters

caption string

The caption that appears on the button. This would typically be a caption that tells the user about the filter, like if the filter selects a meeting, this might be name of the meeting.

removeFilterRequestName string

The request name that will be submitted when this button is pressed. This would typically by 'removeFilter'.

requestNameToClear string

When this button is pressed, the code should read the removeFilterRequestName and if not empty, clear or ignore the requestName matching this string. For example if the filter selects a meeting, this might be the meeting requestName, like meetingId.

addFilterCheckbox(string, string, string, bool)

Add a filter to the current filter group

public abstract void addFilterCheckbox(string caption, string filterHtmlName, string htmlValue, bool selected)

Parameters

caption string
filterHtmlName string
htmlValue string
selected bool

addFilterDateInput(string, string, DateTime?)

Add a filter to the current filter group

public abstract void addFilterDateInput(string caption, string filterHtmlName, DateTime? filterValue)

Parameters

caption string
filterHtmlName string
filterValue DateTime?

addFilterGroup(string)

Creates a new filter group. Filter groups have a caption followed by a list of filter inputs

public abstract void addFilterGroup(string caption)

Parameters

caption string

addFilterRadio(string, string, string, bool)

Add a filter to the current filter group.

public abstract void addFilterRadio(string caption, string filterHtmlName, string filterValue, bool filterSelected)

Parameters

caption string
filterHtmlName string

The name attribute of the html radio element.

filterValue string
filterSelected bool

addFilterSelect(string, string, List<NameValueSelected>)

Add a filter to the current filter group. This is a select input with a list of options.

public abstract void addFilterSelect(string caption, string filterHtmlName, List<NameValueSelected> options)

Parameters

caption string
filterHtmlName string
options List<NameValueSelected>

addFilterSelectContent(string, string, int, string, string)

Add a filter to the current filter group. This is a select input built from the data in a table.

public abstract void addFilterSelectContent(string caption, string filterHtmlName, int filterValue, string content, string sqlCriteria)

Parameters

caption string
filterHtmlName string
filterValue int
content string
sqlCriteria string

addFilterSelectContent(string, string, int, string, string, string)

Add a filter to the current filter group. This is a select input built from the data in a table.

public abstract void addFilterSelectContent(string caption, string filterHtmlName, int filterValue, string content, string sqlCriteria, string nonCaption)

Parameters

caption string
filterHtmlName string
filterValue int
content string

The name of the content (table metadata)

sqlCriteria string
nonCaption string

If provided, an entry will be added allowing the user to select no option

addFilterTextInput(string, string, string)

Add a filter to the current filter group

public abstract void addFilterTextInput(string caption, string filterHtmlName, string filterValue)

Parameters

caption string
filterHtmlName string
filterValue string

addFormButton(string)

add a form button to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormButton(string buttonValue)

Parameters

buttonValue string

addFormButton(string, string)

add a form button to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormButton(string buttonValue, string buttonName)

Parameters

buttonValue string
buttonName string

addFormButton(string, string, string)

add a form button to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormButton(string buttonValue, string buttonName, string buttonId)

Parameters

buttonValue string
buttonName string
buttonId string

addFormButton(string, string, string, string)

add a form button to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormButton(string buttonValue, string buttonName, string buttonId, string buttonClass)

Parameters

buttonValue string
buttonName string
buttonId string
buttonClass string

addFormHidden(string, bool)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, bool value)

Parameters

name string
value bool

addFormHidden(string, bool, string)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, bool value, string htmlId)

Parameters

name string
value bool
htmlId string

addFormHidden(string, DateTime)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, DateTime value)

Parameters

name string
value DateTime

addFormHidden(string, DateTime, string)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, DateTime value, string htmlId)

Parameters

name string
value DateTime
htmlId string

addFormHidden(string, double)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, double value)

Parameters

name string
value double

addFormHidden(string, double, string)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, double value, string htmlId)

Parameters

name string
value double
htmlId string

addFormHidden(string, int)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, int value)

Parameters

name string
value int

addFormHidden(string, int, string)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string name, int value, string htmlId)

Parameters

name string
value int
htmlId string

addFormHidden(string, string)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string Name, string Value)

Parameters

Name string
Value string

addFormHidden(string, string, string)

add a form hidden input to the layout. This will also create a form around the layout. Set blockForm to true to block the automatic form.

public abstract void addFormHidden(string Name, string Value, string htmlId)

Parameters

Name string
Value string
htmlId string

addLinkButton(string, string)

Create a button with a link that does not submit a form. When clicked it anchors to the link

public abstract void addLinkButton(string buttonCaption, string link)

Parameters

buttonCaption string
link string

addLinkButton(string, string, string)

Create a button with a link that does not submit a form. When clicked it anchors to the link

public abstract void addLinkButton(string buttonCaption, string link, string htmlId)

Parameters

buttonCaption string
link string
htmlId string

addLinkButton(string, string, string, string)

Create a button with a link that does not submit a form. When clicked it anchors to the link

public abstract void addLinkButton(string buttonCaption, string link, string htmlId, string htmlClass)

Parameters

buttonCaption string
link string
htmlId string
htmlClass string

getFilterBoolean(string, string)

Get a boolean filter value from the request and/or visit. Use this method to read the value of a filter create with addFilterCheckbox(). This method incorporates both the request object and visit object, so a filter stays set through the visit.

public abstract bool getFilterBoolean(string filterHtmlName, string viewName)

Parameters

filterHtmlName string
viewName string

The name of the view, or form that uses the filter. For example 'attendee list'. This name is used when the filter value is saved so a user returning the page will retain thier fields, and if a filter with the same name on another page is cleared, it will only clear the filter on that page.

Returns

bool

getFilterDate(string, string)

Get a string filter value from the request and/or visit. Use this method to read the value of a filter create with addFilterDate(). This method incorporates both the request object and visit object, so a filter stays set through the visit.

public abstract DateTime? getFilterDate(string filterHtmlName, string viewName)

Parameters

filterHtmlName string
viewName string

The name of the view, or form that uses the filter. For example 'attendee list'. This name is used when the filter value is saved so a user returning the page will retain thier fields, and if a filter with the same name on another page is cleared, it will only clear the filter on that page.

Returns

DateTime?

getFilterInteger(string, string)

Get a string filter value from the request and/or visit. Use this method to read the value of a filter create with addFilterInteger(), addFilterSelect(), addFilterSelectContent(). This method incorporates both the request object and visit object, so a filter stays set through the visit.

public abstract int getFilterInteger(string filterHtmlName, string viewName)

Parameters

filterHtmlName string

The name attribute of the html input element for this filter.

viewName string

The name of the view, or form that uses the filter. For example 'attendee list'. This name is used when the filter value is saved so a user returning the page will retain thier fields, and if a filter with the same name on another page is cleared, it will only clear the filter on that page.

Returns

int

getFilterText(string, string)

Get a string filter value from the request and/or visit. Use this method to read the value of a filter create with addFilterTextInput(), addFilterRadio() This method incorporates both the request object and visit object, so a filter stays set through the visit.

public abstract string getFilterText(string filterHtmlName, string viewName)

Parameters

filterHtmlName string
viewName string

The name of the view, or form that uses the filter. For example 'attendee list'. This name is used when the filter value is saved so a user returning the page will retain thier fields, and if a filter with the same name on another page is cleared, it will only clear the filter on that page.

Returns

string

getHtml()

The default body. Typically you would create a layout by adding content to the individual elements and calling this method. Oveerride this method and consider using HtmlController.getReportDoc()

public abstract string getHtml()

Returns

string

getHtml(CPBaseClass)

[Obsolete("Deprecated. use getHtml().", false)]
public abstract string getHtml(CPBaseClass cp)

Parameters

cp CPBaseClass

Returns

string