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
cpCPBaseClass
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
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
baseUrl
deprecated. Instead use cp.adminUI.getPortalFeatureLink()
[Obsolete("deprecated. Instead use cp.adminUI.getPortalFeatureLink()", false)]
public abstract string baseUrl { get; }
Property Value
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
body
The body of the layout.
public abstract string body { get; set; }
Property Value
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
cp
public CPBaseClass cp { get; set; }
Property Value
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
description
simple description text. Will be wrapped in an html paragraph tag.
public abstract string description { get; set; }
Property Value
failMessage
message displayed as a fail message. Data is wrong
public abstract string failMessage { get; set; }
Property Value
footer
deprecated. Use htmlAfterBody instead
[Obsolete("Deprecated. Use htmlAfterBody instead", false)]
public abstract string footer { get; set; }
Property Value
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
formid
deprecated. Use warningMessage instead
[Obsolete("Deprecated. Use addFormHidden instead", false)]
public abstract string formid { get; set; }
Property Value
htmlAfterBody
An html block added below the Body. Typically used for filters.
public abstract string htmlAfterBody { get; set; }
Property Value
htmlBeforeBody
An html block added above the Body. Typically used for filters.
public abstract string htmlBeforeBody { get; set; }
Property Value
htmlLeftOfBody
An html block added to the left of the Body. Typically used for filters.
public abstract string htmlLeftOfBody { get; set; }
Property Value
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
includeBodyPadding
if true, the container between the button rows will include default padding
public abstract bool includeBodyPadding { get; set; }
Property Value
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
infoMessage
message displayed as an informational message. Nothing is wrong, but the user should know
public abstract string infoMessage { get; set; }
Property Value
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
javascript
The default Layoutbuilder script. Override to customize.
[Obsolete("move javascript and styles to layouts", false)]
public abstract string javascript { get; }
Property Value
portalSubNavTitle
[Obsolete("Use portalSubNavTitleList instead. Deprecated.", false)]
public abstract string portalSubNavTitle { get; set; }
Property Value
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
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
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
styleSheet
The default Layoutbuilder styles. Override to customize.
[Obsolete("move javascript and styles to layouts", false)]
public abstract string styleSheet { get; }
Property Value
successMessage
message displayed as a success message.
public abstract string successMessage { get; set; }
Property Value
title
The headline at the top of the form
public abstract string title { get; set; }
Property Value
warning
deprecated. Use warningMessage instead
[Obsolete("Deprecated. Use warningMessage instead", false)]
public abstract string warning { get; set; }
Property Value
warningMessage
message displayed as a warning message. Not an error, but an issue of some type
public abstract string warningMessage { get; set; }
Property Value
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
captionstringThe 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.
removeFilterRequestNamestringThe request name that will be submitted when this button is pressed. This would typically by 'removeFilter'.
requestNameToClearstringWhen 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
addFilterDateInput(string, string, DateTime?)
Add a filter to the current filter group
public abstract void addFilterDateInput(string caption, string filterHtmlName, DateTime? filterValue)
Parameters
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
captionstring
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
captionstringfilterHtmlNamestringThe name attribute of the html radio element.
filterValuestringfilterSelectedbool
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
captionstringfilterHtmlNamestringoptionsList<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
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
captionstringfilterHtmlNamestringfilterValueintcontentstringThe name of the content (table metadata)
sqlCriteriastringnonCaptionstringIf 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
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
buttonValuestring
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
filterHtmlNamestringviewNamestringThe 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
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
filterHtmlNamestringviewNamestringThe 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
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
filterHtmlNamestringThe name attribute of the html input element for this filter.
viewNamestringThe 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
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
filterHtmlNamestringviewNamestringThe 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
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
getHtml(CPBaseClass)
[Obsolete("Deprecated. use getHtml().", false)]
public abstract string getHtml(CPBaseClass cp)
Parameters
cpCPBaseClass