Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FormViewer :How to transfer data in the presence of a modal #78

Unanswered
Caesar-ch asked this question in Q&A
Discussion options

Hi,

I created two forms from formbuilder. The button in Form A will open a modal to display Form B.

There are two forms of data in IndexDB. How can I use formViewer to display the overall effect? The button in A opens a modal window to show B. I tried it, but it can only display the data of one of the forms. Clicking the button in A will open the modal, but the content still displays the data from form A.

I would appreciate it if you could show me the entire case.

image
You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

@Caesar-ch

The form of the modal window is loaded via the getForm function (https://formengine.io/documentation/api-reference/@react-form-builder/core/interfaces/FormViewerProps#getform), to which the name of the form of the modal window is passed. You need to make the getForm function return different strings depending on the function parameters.

You must be logged in to vote
2 replies
Comment options

I have prepared the following data to pass to FormViewer

const form = { "form": { "key": "Screen", "type": "Screen", "props": { "disabled": { "value": false } }, "css": { "any": { "object": { "flexDirection": "column" } } }, "children": [ { "key": "rsButton1", "type": "RsButton", "props": {}, "events": { "onClick": [ { "name": "openModal", "type": "common", "args": { "modalKey": "modal1" } } ] } }, { "key": "modal1", "type": "Modal", "props": { "modalTemplate": { "value": "Template:2" } }, "modal": { "props": {}, "events": {} } }, { "key": "rsSearch1", "type": "RsSearch", "props": { "label": { "value": "" } }, "events": { "onSearch": [ { "name": "search", "type": "code" } ] } } ] } }

From the data, it can be seen that a button will open the Modal.

My question is, how should I transfer the data presented by the Modal?

Currently, the Modal only indicates the name of the modalTemplate.

Could you provide me with some demo data?

Comment options

@Caesar-ch Sure. Take a look into this part of the documentation https://formengine.io/documentation/modal-components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /