rememberDocumentEditor

fun rememberDocumentEditor(document: Document, config: FormConfig, validateSchema: Boolean = true, identity: IdentityGenerator = IdentityGenerator.default, onError: ErrorHandler = NoOpErrorHandler): DocumentEditor

Remember a DocumentEditor for a given Document across recompositions. Uses Compose remember with inputs to recreate the editor when they change.

Parameters

document

Backing document for the editor.

config

Unified configuration (mode, events, display, pages, functions, ...).

validateSchema

If true, validate the document schema on construction.

identity

Identity generator used for new items/rows.

onError

Error handler for evaluation/validation failures.


fun rememberDocumentEditor(json: String, config: FormConfig, validateSchema: Boolean = true, identity: IdentityGenerator = IdentityGenerator.default, onError: ErrorHandler = NoOpErrorHandler): DocumentEditor

Remember a DocumentEditor for a JSON string input across recompositions.

Parameters

json

String-encoded JSON for the document.

config

Unified configuration (mode, events, display, pages, functions, ...).

validateSchema

If true, validate the document schema on construction.

identity

Identity generator used for new items/rows.

onError

Error handler for evaluation/validation failures.


fun rememberDocumentEditor(bytes: ByteArray, config: FormConfig, validateSchema: Boolean = true, identity: IdentityGenerator = IdentityGenerator.default, onError: ErrorHandler = NoOpErrorHandler): DocumentEditor

Remember a DocumentEditor for raw JSON bytes across recompositions.

Streams the document straight from the bytes (via editorOf) without decoding them to an intermediate String, so opening a large document avoids holding a full extra copy in memory. Prefer this when the JSON comes from a file / network / bundled resource.

Parameters

bytes

UTF-8 encoded JSON for the document.

config

Unified configuration (mode, events, display, pages, functions, ...).

validateSchema

If true, validate the document schema on construction.

identity

Identity generator used for new items/rows.

onError

Error handler for evaluation/validation failures.


fun rememberDocumentEditor(document: Document, validateSchema: Boolean = true, identity: IdentityGenerator = IdentityGenerator.default, layout: LayoutConfig = LayoutConfig.convenientMobile(), functions: ResolutionResourceBuilder.() -> Unit? = null, onError: ErrorHandler = NoOpErrorHandler, onChange: DocumentEditor.(ChangeEvent) -> Unit? = null): DocumentEditor

Deprecated

Use rememberDocumentEditor(document, config) instead.

Replace with

rememberDocumentEditor(document, FormConfig.Default, validateSchema, identity, onError)

fun rememberDocumentEditor(json: String, validateSchema: Boolean = true, identity: IdentityGenerator = IdentityGenerator.default, layout: LayoutConfig = LayoutConfig.convenientMobile(), functions: ResolutionResourceBuilder.() -> Unit? = null, onError: ErrorHandler = NoOpErrorHandler, onChange: DocumentEditor.(ChangeEvent) -> Unit? = null): DocumentEditor

Deprecated

Use rememberDocumentEditor(json, config) instead.

Replace with

rememberDocumentEditor(json, FormConfig.Default, validateSchema, identity, onError)

fun rememberDocumentEditor(bytes: ByteArray, validateSchema: Boolean = true, identity: IdentityGenerator = IdentityGenerator.default, layout: LayoutConfig = LayoutConfig.convenientMobile(), functions: ResolutionResourceBuilder.() -> Unit? = null, onError: ErrorHandler = NoOpErrorHandler, onChange: DocumentEditor.(ChangeEvent) -> Unit? = null): DocumentEditor

Deprecated

Use rememberDocumentEditor(bytes, config) instead.

Replace with

rememberDocumentEditor(bytes, FormConfig.Default, validateSchema, identity, onError)