Pre-populated Form Input

1
0
-1

Hello All,

It's very clear how to read complex data in a form and send it back to the activity in the server.

But how do I pre-fill a complex Input object so I have default data in the form?

Thank you.

Comments

Submitted by antoine.mottier on Tue, 08/01/2017 - 10:14

Do you want to pre-fill the form with some static values?

Submitted by edo_2 on Tue, 08/01/2017 - 16:26

Antoine,

Not really. I want to display a DBM object retrieved from the database with a find method.

Thank you.

1 answer

1
0
-1

The way we did this was as follows (I think as I'm not at my desk/with document)

Assume read the last record...

Create a page variable of type API with query to get the last record
Create variables referencing the page variable to get the individual fields
Change the form fields to point to these new variables
Change the formOutput variable from the generated $data.formoutput... to reference the individual fields so it can return them rather than the input fields....

Something like that.

regards
Seán

Comments

Submitted by edo_2 on Tue, 08/01/2017 - 16:28

Sean,

Thank you for sharing your method.

I think it would do what I want, but I was looking for a simpler method. Something like reading the BDM object from the table, assign it to the Input structure, and just create the form starting from the input structure.

Cheers,

Submitted by Sean McP on Tue, 08/01/2017 - 20:01

Yeah we wanted to do it that way too, but pre-filling an Instantiation Form can't be done that way...the only way we found was to do it as above...

Regards

Notifications