EditableLiteral

in namespace DotVVM.BusinessPack.Controls

Renders a EditableLiteral control which can be edited by mouse click

Usage & Scenarios

EditableLiteral displays a bound value as text until you click it to edit in place. Press Enter to save the edit or Escape to discard it.

Sample 1: Editing a line item

Bind Text to a writable string property. Click the description, type a new name, and press Enter to update the line item. Press Escape instead to discard an edit. Leave RenderSpanElement enabled so the control has a clickable text element.

<p>Description (click to edit):</p>
<bp:EditableLiteral Text="{value: Description}" />
<p>Line item: {{value: Description}}</p>
using DotVVM.Framework.ViewModel;

namespace DotvvmWeb.Views.Docs.Controls.businesspack.EditableLiteral.sample1
{
    public class ViewModel : DotvvmViewModelBase
    {
        public string Description { get; set; } = "Notebook";
    }
}

Properties

Name Type Description Notes Default Value
property icon FormatString String Gets or sets the format string that will be applied to numeric or date-time values.
attribute
inner element
static value
bindable
default
property icon RenderSpanElement Boolean Gets or sets whether the literal should render the wrapper span HTML element.
attribute
inner element
static value
bindable
default
True
property icon Text String Gets or sets the text displayed in the control.
attribute
inner element
static value
bindable
default
property icon ValueType FormatValueType FormatValueType Gets or sets the type of value being formatted - Number or DateTime.
attribute
inner element
static value
bindable
default
Text

HTML produced by the control