mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
166 lines
6.1 KiB
166 lines
6.1 KiB
@page
|
|
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
|
|
@model DynamicFormsModel
|
|
|
|
@{
|
|
ViewData["Title"] = "Forms";
|
|
}
|
|
|
|
<h2>Dynamic Forms</h2>
|
|
|
|
<h4># Dynamic Form Example</h4>
|
|
|
|
<div class="demo-with-code">
|
|
<div class="demo-area">
|
|
<abp-dynamic-form abp-model="@Model.PersonInput"/>
|
|
<hr />
|
|
<h5>Posted Values:</h5>
|
|
<div>
|
|
Name: @Model.PersonInput.Name <br />
|
|
City: @Model.PersonInput.City <br />
|
|
Phone.Name: @Model.PersonInput.Phone.Name <br />
|
|
Phone.Number: @Model.PersonInput.Phone.Number <br />
|
|
Day: @Model.PersonInput.Day.ToString("yyyy-MM-dd") <br />
|
|
Country: @Model.PersonInput.Country <br />
|
|
IsActive: @Model.PersonInput.IsActive <br />
|
|
</div>
|
|
</div>
|
|
<div class="code-area">
|
|
<pre>
|
|
<abp-dynamic-form abp-model="Model.PersonInput"/>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<h4># Override an input Example</h4>
|
|
|
|
<div class="demo-with-code">
|
|
<div class="demo-area">
|
|
<abp-dynamic-form abp-model="@Model.PersonInput">
|
|
<abp-input asp-for="@Model.PersonInput.Name" label="Overrided name" />
|
|
<abp-input asp-for="@Model.PersonInput.Phone.Number" label="Overrided number" />
|
|
<abp-button button-type="Primary" type="submit" text="submit" />
|
|
</abp-dynamic-form>
|
|
<hr />
|
|
<h5>Posted Values:</h5>
|
|
<div>
|
|
Name: @Model.PersonInput.Name <br />
|
|
City: @Model.PersonInput.City <br />
|
|
Phone.Name: @Model.PersonInput.Phone.Name <br />
|
|
Phone.Number: @Model.PersonInput.Phone.Number <br />
|
|
Day: @Model.PersonInput.Day.ToString("yyyy-MM-dd") <br />
|
|
Country: @Model.PersonInput.Country <br />
|
|
IsActive: @Model.PersonInput.IsActive <br />
|
|
</div>
|
|
</div>
|
|
<div class="code-area">
|
|
<pre>
|
|
<abp-dynamic-form abp-model="Model.PersonInput">
|
|
<abp-input asp-for="Model.PersonInput.Name" label="Overrided name" />
|
|
<abp-input asp-for="Model.PersonInput.Phone.Number" label="Overrided number" />
|
|
<abp-button button-type="Primary" type="submit" text="submit" />
|
|
</abp-dynamic-form>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<h4># Form with Button Example</h4>
|
|
|
|
<div class="demo-with-code">
|
|
<div class="demo-area">
|
|
<abp-dynamic-form abp-model="@Model.PersonInput.Phone" submit-button="true" />
|
|
<hr />
|
|
<h5>Posted Values:</h5>
|
|
<div>
|
|
Name: @Model.PersonInput.Name <br />
|
|
City: @Model.PersonInput.City <br />
|
|
Phone.Name: @Model.PersonInput.Phone.Name <br />
|
|
Phone.Number: @Model.PersonInput.Phone.Number <br />
|
|
Day: @Model.PersonInput.Day.ToString("yyyy-MM-dd") <br />
|
|
Country: @Model.PersonInput.Country <br />
|
|
IsActive: @Model.PersonInput.IsActive <br />
|
|
</div>
|
|
</div>
|
|
<div class="code-area">
|
|
<pre>
|
|
<abp-dynamic-form abp-model="Model.PersonInput" submit-button="true"/>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<h4># Non-dynamic Form </h4>
|
|
|
|
<div class="demo-with-code">
|
|
<div class="demo-area">
|
|
<form method="post">
|
|
<abp-input asp-for="@Model.PersonInput.Name" />
|
|
<abp-input asp-for="@Model.PersonInput.Age" />
|
|
<abp-input asp-for="@Model.PersonInput.IsActive" />
|
|
<abp-input asp-for="@Model.PersonInput.Day" />
|
|
<abp-select asp-for="@Model.PersonInput.City" />
|
|
<abp-select asp-for="@Model.PersonInput.Country" />
|
|
<abp-input asp-for="@Model.PersonInput.Phone.Number" />
|
|
<abp-input asp-for="@Model.PersonInput.Phone.Name" />
|
|
<abp-button type="submit" button-type="Primary" text="Submit" />
|
|
</form>
|
|
<hr />
|
|
<h5>Posted Values:</h5>
|
|
<div>
|
|
Name: @Model.PersonInput.Name <br />
|
|
Age: @Model.PersonInput.Age <br />
|
|
Is Active: @Model.PersonInput.IsActive <br />
|
|
Day: @Model.PersonInput.Day <br />
|
|
City: @Model.PersonInput.City <br />
|
|
Country: @Model.PersonInput.Country <br />
|
|
Phone.Number: @Model.PersonInput.Phone.Number <br />
|
|
Phone.Name: @Model.PersonInput.Phone.Name <br />
|
|
</div>
|
|
</div>
|
|
<div class="code-area">
|
|
<pre>
|
|
<form method="post">
|
|
<abp-input asp-for="Model.PersonInput.Name" />
|
|
<abp-input asp-for="Model.PersonInput.Age" />
|
|
<abp-input asp-for="Model.PersonInput.IsActive" />
|
|
<abp-input asp-for="Model.PersonInput.Day" />
|
|
<abp-select asp-for="Model.PersonInput.City" />
|
|
<abp-select asp-for="Model.PersonInput.Country" />
|
|
<abp-input asp-for="Model.PersonInput.Phone.Number" />
|
|
<abp-input asp-for="Model.PersonInput.Phone.Name" />
|
|
<abp-button type="submit" button-type="Primary" text="Submit" />
|
|
</form>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<h4># Form Content Placement </h4>
|
|
|
|
<div class="demo-with-code">
|
|
<div class="demo-area">
|
|
<abp-dynamic-form abp-model="@Model.PersonInput">
|
|
<abp-form-content />
|
|
<abp-button button-type="Primary" type="submit" text="submit" />
|
|
</abp-dynamic-form>
|
|
<hr />
|
|
<h5>Posted Values:</h5>
|
|
<div>
|
|
Name: @Model.PersonInput.Name <br />
|
|
City: @Model.PersonInput.City <br />
|
|
Phone.Name: @Model.PersonInput.Phone.Name <br />
|
|
Phone.Number: @Model.PersonInput.Phone.Number <br />
|
|
Day: @Model.PersonInput.Day.ToString("yyyy-MM-dd") <br />
|
|
Country: @Model.PersonInput.Country <br />
|
|
IsActive: @Model.PersonInput.IsActive <br />
|
|
</div>
|
|
</div>
|
|
<div class="code-area">
|
|
<pre>
|
|
<abp-dynamic-form abp-model="@Model.PersonInput">
|
|
<abp-form-content />
|
|
<abp-button button-type="Primary" type="submit" text="submit" />
|
|
</abp-dynamic-form>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|