I want to dynamically add items to a frontend form from a backend table. I have the connection to the database working and the values rendering on the form as Checkbox labels, and I put an input box on the forum just to see what happens. The inputs do not show up in the form data on submit.
I tried it with a text input as well and as soon as I put the input into the dynamic list behavior block it stops showing up in the form data.
As I see, you bind values from the inputs to Seller Share Seller Block, and thatâs why you get an empty object when trying to show an alert with AddSellerFundraiserForm data.
Another related question. I on my form I have an input FirstName that is bound to AddSellerFundraiserForm. If there is a value in the input, it will show up in the alert from the AddSellerFundraiserForm Data. But if the value is blank, nothing shows up.
Why doesnât AddSellerFundraiserForm Data have FirstName: ââ or something to show that the value is blank? How do you edit something and remove a value if the lack of a value isnât returned?
This seems like a lot of work for something that feels like it should happen automatically as the elements are inside the form. What is the purpose of the form element if you have to manually bind the inputs? It also seems like a problem that the default value binding and the submit value binding are in conflict with each other.
I am binding the inputs as I need the values to come from the table object I load on page enter.
Iâm trying to build a dynamic form so the values have to be bound to the Dynamic Link Block.
Logic at your screenshot looks right. And as I see in your app now, you get success with dynamic rendering.
Another related question ⌠Why doesnât AddSellerFundraiserForm Data have FirstName: ââ or something to show that the value is blank? How do you edit something and remove a value if the lack of a value isnât returned?
As I say earlier, your input have incorrect binding(to Dynamic Block, not to Form)
This seems like a lot of work for something that feels like it should happen automatically as the elements are inside the form. What is the purpose of the form element if you have to manually bind the inputs?
First of all, it is a semantically correct way to build your app. Also, this component creates an storage - Form Data Model and some events like Submit and Reset.
You could bind value to Form Data Model in the same way as to Page Data Model. With or without creating handler. But pay attention to a hind under handler. I think some misunderstandings comes from there.
It also seems like a problem that the default value binding and the submit value binding are in conflict with each other.
Why would it not show as blank in the first example?
Could you tell me what is submit value binding?
EDIT: Better explanation. In traditional HTML inputs inside the form tag are bound to the form object. That binding doesnât stop you from binding the value to another object. The inputs have a name and a value for a form input, like this:
On form submit ânameâ, in this case Email will show up in the submit object as a key, so Iâm calling that the submit binding. There is also âvalueâ which lets you set the value from a DB or whatever. So you can bind the incoming data and the outgoing submit data. The input field in UI-builder doesnât have a name field so it seems like you can only bind to one or the other. Is that not right?
Because empty value(empty string) is still value, and while you do not trigger binding by touching input, value does not come to Data Model. By default data model is an empty object.
So you can bind the incoming data and the outgoing submit data.
If you bind your input to a Page Data property for example. And fill this property from your DB, input will react on it, and change the shown value. When you touch input and change value, that would change bound Page Data property.
That names two-way data binding. Here is a little example, where you could bind data from input to storage, and from storage to input(by clicking a button) - link
There is also âvalueâ which lets you set the value from a DB or whateverâŚ
âŚThe input field in UI-builder doesnât have a name field
This is not a native feature, and I canât be sure, but this might be two-directional binding(and we provide it). Or initial value for component - we also give this possibility.