Skip to content

forms(qml): no way to load an existing payload into a DynamicForm (JSON -> draft), which a collection slot needs to edit stored rows #814

Description

@Yaraslaut

Verification: inferred from reading DynamicForm.qml, CollectionView.qml and WizardView.qml on master 05222af.

Every prefill path writes control text: CollectionView locates field_<name> and sets .text; WizardView calls setFieldValue(name, text). Nothing converts a wire value into the text the form's draft holds, so a caller editing an existing record has to do it by hand per kind — {num,den,dp} → locale digits for a Quantity, an ISO string → display-zone wall clock for a Timestamp, a value → its option's valueJson for a closed set.

This bites hardest for a std::vector<Row> drawn by a slot (#809): the slot's rows are {member: cellText}, and turning a stored [{"sieve":31.5,"passing":{"num":1000,"den":10,"dp":1}}] back into cell texts is the inverse of encodeFieldText, which does not exist.

Proposal: DynamicForm.decodeFieldValue(field, jsonValue) -> text (the inverse of encodeFieldText, locale- and zone-aware) and DynamicForm.prefillFromJson(payloadText) built on it, covering object-array rows cell by cell.

Closes when form.prefillFromJson(form.previewLine) on a ready form reproduces the same previewLine, for every field kind including a slot-drawn collection.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions