Table of Contents

Class EditForm

Namespace
Dynamicweb.Content.Items.Editors
Assembly
Dynamicweb.dll
Represents an edit form. This class cannot be inherited.
[Obsolete("Do not use")]
public sealed class EditForm
Inheritance
EditForm
Inherited Members

Constructors

EditForm()

Initializes a new instance of an object.
public EditForm()

EditForm(string)

Initializes a new instance of an object.
public EditForm(string name)

Parameters

name string
Form name.

Properties

AreaId

Gets or sets current area id.
public int AreaId { get; set; }

Property Value

int

Fields

Gets or sets the collection of form fields.
public EditFormFieldCollection Fields { get; set; }

Property Value

EditFormFieldCollection

Groups

Gets or sets the collection of form groups.
public EditFormGroupCollection Groups { get; set; }

Property Value

EditFormGroupCollection

Location

Gets or sets where form is used
public EditForm.FormLocation Location { get; set; }

Property Value

EditForm.FormLocation

Name

Gets or sets the name of this form.
public string Name { get; set; }

Property Value

string

NestingLevel

Gets or sets nesting level of rendering.
public int NestingLevel { get; set; }

Property Value

int

Renderer

Gets or sets the edit form renderer.
public EditFormRenderer Renderer { get; set; }

Property Value

EditFormRenderer

TagNamespace

Gets or sets tags namespace.
public string TagNamespace { get; set; }

Property Value

string

Template

Gets or sets renderer template.
public Template Template { get; set; }

Property Value

Template

Methods

FromItem(ItemType, ItemEntry)

Creates a form from the given item.
public static EditForm FromItem(ItemType itemMeta, ItemEntry item)

Parameters

itemMeta ItemType
Item metadata.
item ItemEntry
Item instance.

Returns

EditForm
Form.

FromItem(ItemType, ItemEntry, EditFormRenderer)

Creates a form from the given item.
public static EditForm FromItem(ItemType itemMeta, ItemEntry item, EditFormRenderer renderer)

Parameters

itemMeta ItemType
Item metadata.
item ItemEntry
Item instance.
renderer EditFormRenderer

Returns

EditForm
Form.

FromItem(string, ItemType, ItemEntry)

Creates a form from the given item.
public static EditForm FromItem(string parentSystemName, ItemType itemMeta, ItemEntry item)

Parameters

parentSystemName string
Parent.
itemMeta ItemType
Item metadata.
item ItemEntry
Item instance.

Returns

EditForm
Form.

FromItem(string, ItemType, ItemEntry, EditFormRenderer)

Creates a form from the given item.
public static EditForm FromItem(string parentSystemName, ItemType itemMeta, ItemEntry item, EditFormRenderer renderer)

Parameters

parentSystemName string
itemMeta ItemType
Item metadata.
item ItemEntry
Item instance.
renderer EditFormRenderer
Item renderer.

Returns

EditForm
Form.

GetKeyPrefix(string)

Get the prefix of an edit form key. Used in item field editors to handle the case where they are used in item types included in other item types.
public static string GetKeyPrefix(string key)

Parameters

key string
An editor key

Returns

string
The prefix of the key or the empty string if not prefix exists

ReadFromRequest(string)

Reads form fields from the current request.
public static EditForm ReadFromRequest(string formName)

Parameters

formName string
Form name.

Returns

EditForm
Form fields.

ReadFromRequest(string, bool)

Reads form fields from the current request.
public static EditForm ReadFromRequest(string formName, bool cleanup)

Parameters

formName string
Form name.
cleanup bool
Value indicating whether to automatically flush the given form state from the current HTTP session.

Returns

EditForm
Form fields.

Render(TextWriter)

Renders form.
public void Render(TextWriter output)

Parameters

output TextWriter
Output stream.

RenderContents(TextWriter)

Renders form contents.
public void RenderContents(TextWriter output)

Parameters

output TextWriter
Output stream.

RenderField(EditFormField, TextWriter)

Renders form field.
public void RenderField(EditFormField field, TextWriter output)

Parameters

field EditFormField
Field to render.
output TextWriter
Output stream.

RenderField(int, TextWriter)

Renders form field.
public void RenderField(int index, TextWriter output)

Parameters

index int
Zero-based index of the field.
output TextWriter
Output stream.

RenderFields(Func<EditFormField, bool>, TextWriter)

Renders all form fields fields.
public void RenderFields(Func<EditFormField, bool> selector, TextWriter output)

Parameters

selector Func<EditFormField, bool>
A function that determines which fields to render
output TextWriter
Output stream.

RenderFields(TextWriter)

Renders all form fields fields.
public void RenderFields(TextWriter output)

Parameters

output TextWriter
Output stream.

RenderHeader(TextWriter)

Renders form header.
public void RenderHeader(TextWriter output)

Parameters

output TextWriter
Output stream.

ToItem(ItemType, ItemEntry)

Reads the current form from the request and constructs the item instance from the form values.
public static ItemEntry ToItem(ItemType itemMeta, ItemEntry previousState)

Parameters

itemMeta ItemType
Item metadata.
previousState ItemEntry
Previous state of the item (for values that were not populated on the form).

Returns

ItemEntry
Item instance.

ToItem(ItemType, ItemEntry, bool)

Reads the current form from the request and constructs the item instance from the form values.
[Obsolete("Use ToItem(ItemType, ItemEntry)")]
public static ItemEntry ToItem(ItemType itemMeta, ItemEntry previousState, bool cleanup)

Parameters

itemMeta ItemType
previousState ItemEntry
cleanup bool

Returns

ItemEntry

ToItem(string, ItemType, ItemEntry)

Reads the current form from the request and constructs the item instance from the form values.
public static ItemEntry ToItem(string parentSystemName, ItemType itemMeta, ItemEntry previousState)

Parameters

parentSystemName string
itemMeta ItemType
previousState ItemEntry

Returns

ItemEntry

ToItem(string, ItemType, ItemEntry, bool)

Reads the current form from the request and constructs the item instance from the form values.
[Obsolete("Use ToItem(String, ItemType, ItemEntry)")]
public static ItemEntry ToItem(string parentSystemName, ItemType itemMeta, ItemEntry previousState, bool cleanup)

Parameters

parentSystemName string
itemMeta ItemType
Item metadata.
previousState ItemEntry
Previous state of the item (for values that were not populated on the form).
cleanup bool
Value indicating whether to automatically flush the given form state from the current HTTP session.

Returns

ItemEntry
Item instance.

ToItem<T>(ItemType, T)

Reads the current form from the request and constructs the item instance from the form values.
public static T ToItem<T>(ItemType itemMeta, T previousState) where T : ItemEntry, new()

Parameters

itemMeta ItemType
Item metadata.
previousState T
Previous state of the item (for values that were not populated on the form).

Returns

T
Item instance.

Type Parameters

T
Item type.

ToItem<T>(ItemType, T, bool)

Reads the current form from the request and constructs the item instance from the form values.
public static T ToItem<T>(ItemType itemMeta, T previousState, bool cleanup) where T : ItemEntry, new()

Parameters

itemMeta ItemType
Item metadata.
previousState T
Previous state of the item (for values that were not populated on the form).
cleanup bool
Value indicating whether to automatically flush the given form state from the current HTTP session.

Returns

T
Item instance.

Type Parameters

T
Item type.

Validate(ItemType, Item, Action<bool, EditFormField, Validator>)

public static bool Validate(ItemType itemType, Item item, Action<bool, EditFormField, Validator> result)

Parameters

itemType ItemType
item Item
result Action<bool, EditFormField, Validator>

Returns

bool
To top