Skip to content

Commit c4a6c93

Browse files
Language check for PR #2733 (#3155)
1 parent 12404f7 commit c4a6c93

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

articles/hilla/lit/guides/forms/reference.adoc

+24-19
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: Understanding form binding.
99

1010
// tag::content[]
1111

12-
The key concepts behind form binding are: the [methodname]`field()` directive, the [classname]`Model`, the [classname]`Binder` and binder nodes.
12+
The key concepts behind form binding are the [methodname]`field()` directive, the [classname]`Model`, the [classname]`Binder` and binder nodes.
1313

1414

1515
== The Field Directive
@@ -18,15 +18,15 @@ ifdef::hilla-lit[]
1818
Form binding in Hilla works together with the Lit web component library and its underlying template rendering library, `lit-html`.
1919
endif::hilla-lit[]
2020

21-
The [methodname]`field()` directive does the main task of binding the form field components in the template:
21+
The [methodname]`field()` directive does the main task of binding the form field components in the template by doing the following:
2222

2323
- sets the `name` attribute;
2424
- implements two-way binding for the value state;
2525
- sets the `required` (boolean) state; and
2626
- sets the `invalid` (boolean) state and the `errorMessage` (string) when the current value is invalid.
2727

2828
ifdef::hilla-react[]
29-
.Using the field directive
29+
.Using the Field Directive
3030
[source,tsx]
3131
----
3232
import {TextField} from "@vaadin/react-components/TextField.js";
@@ -38,8 +38,9 @@ return (
3838
);
3939
----
4040
endif::hilla-react[]
41+
4142
ifdef::hilla-lit[]
42-
.Using the field directive
43+
.Using the Field Directive
4344
[source,html]
4445
----
4546
<vaadin-text-field
@@ -53,10 +54,10 @@ Depending on the type of the bound component, the field directive selects a stra
5354

5455
ifdef::hilla-lit[]
5556
[NOTE]
56-
You can find more information on field strategy customization in the <<{articles}/hilla/lit/guides/forms/web-component-field-strategy#, Using a Web Component Field>> article.
57+
You can find more information on field strategy customization on the <<{articles}/hilla/lit/guides/forms/web-component-field-strategy#, Using a Web Component Field>> page.
5758
endif::hilla-lit[]
5859

59-
The field directive supports Vaadin components and HTML input elements. Vaadin components have support for all the states. However, for HTML input elements, the `invalid`, `required` and `errorMessage` states aren't displayed in the bound component. As a workaround, you can bind these manually in the template:
60+
The field directive supports Vaadin components and HTML input elements. Vaadin components have support for all of the states. However, for HTML input elements, the `invalid`, `required` and `errorMessage` states aren't displayed in the bound component. As a workaround, you can manually bind these in the template:
6061

6162
ifdef::hilla-react[]
6263
[source,tsx]
@@ -114,8 +115,8 @@ ${
114115
----
115116
endif::hilla-lit[]
116117

117-
[NOTE]
118-
See also: <<{articles}/hilla/lit/guides/forms/vaadin-components#, Binding Data to Hilla Components>>
118+
See the <<{articles}/hilla/lit/guides/forms/vaadin-components#, Binding Data to Hilla Components>> for more, related information.
119+
119120

120121

121122
== The Form Model
@@ -130,27 +131,25 @@ to specify the target form property to create a binding or to access the state.
130131

131132
Hilla automatically generates Model classes for server-side endpoints from Java beans. There's usually no need to define models, manually.
132133

133-
Technically, every model instance represents either a key of a parent model, or the value of the [classname]`Binder` itself (for example, the form data object).
134+
Technically, every model instance represents either a key of a parent model, or the value of the [classname]`Binder` itself (e.g., the form data object).
134135

135136
[NOTE]
136-
====
137137
The model classes aren't intended to be instantiated manually. Instead, the [classname]`Binder` constructor receives the form model class and takes care of creating model instances.
138-
====
139138

140139

141140
=== Primitive Models
142141

143142
These are the built-in models that represent the common primitive field types:
144143

145144
|===
146-
| Type | Value type `T` | Empty value ([methodname]`Model.createEmptyValue()` result)
145+
| Type | Value type `T` | Empty Value ([methodname]`Model.createEmptyValue()` result)
147146

148147
| [classname]`StringModel` | `string` | `''`
149148
| [classname]`NumberModel` | `number` | `0`
150149
| [classname]`BooleanModel` | `boolean` | `false`
151150
|===
152151

153-
Primitive models extend [classname]`PrimitiveModel<T>`. Primitive models are leaf nodes of the data structure; that is, they don't have nested field keys.
152+
Primitive models extend [classname]`PrimitiveModel<T>`. Primitive models are leaf nodes of the data structure; they don't have nested field keys.
154153

155154

156155
=== Object Models
@@ -243,13 +242,12 @@ export default class PersonModel<T extends Person = Person> extends IdEntityMode
243242
----
244243

245244
[CAUTION]
246-
====
247245
To avoid naming collisions with user-defined object model fields, the built-in models and model superclasses don't have any public instance properties or methods, aside from the [methodname]`toString()` and [methodname]`valueOf()` methods inherited from [classname]`AbstractModel<T>` (see following).
248-
====
249246

250247
The properties of object models are intentionally read-only.
251248

252-
=== The Array Model
249+
250+
=== Array Model
253251

254252
[classname]`ArrayModel<T>` is used to represent array properties.
255253

@@ -306,12 +304,12 @@ endif::hilla-lit[]
306304
The array entries aren't available for indexing with bracket notation (`[]`).
307305

308306

309-
=== The Abstract Model Superclass
307+
=== Abstract Model Superclass
310308

311309
All models subclass from the [classname]`AbstractModel<T>` TypeScript class, where the `T` type argument refers to the value type.
312310

313311

314-
==== The Empty Value Definition
312+
==== Empty Value Definition
315313

316314
Model classes define an empty value, which is used to initialize the `defaultValue` and `value` properties, and also for [methodname]`clear()`.
317315

@@ -350,7 +348,7 @@ return (
350348
)
351349
----
352350

353-
Then, it is possible to use the values in formulas using either of the followings:
351+
Then, it's possible to use the values in formulas using either of the following:
354352

355353
[source,tsx]
356354
----
@@ -432,6 +430,7 @@ Sets the form to empty value, as defined in the Model.
432430
Determines and returns the `field` directive strategy for the bound element. Override to customize the binding strategy for a component. The [classname]`Binder` extends [classname]`BinderNode`; see the inherited properties and methods that follow.
433431

434432

433+
435434
== Binder Nodes [[binder-node]]
436435

437436
The [classname]`BinderNode<T, M>` class provides the form-binding-related APIs with respect to a particular model instance.
@@ -490,3 +489,9 @@ A helper method for array modes, similar to [methodname]`appendItem()`, but prep
490489
A helper method for array item models. If the node's **parent model** is an [classname]`ArrayModel<T>`, removes the item the array; otherwise throws an exception.
491490

492491
// end::content[]
492+
493+
++++
494+
<style>
495+
[class^=PageHeader-module--descriptionContainer] {display: none;}
496+
</style>
497+
++++

0 commit comments

Comments
 (0)