200
Views
13
Comments
Solved
how to create a form fields dynamically based on values from database.
Application Type
Reactive

I want to create a form and type of the form fields will be decided based on value from data table.

2023-08-28 07-00-10
Paulo Torres
Champion
Solution

Hi @Shree harsha,

I prepared this code for you: https://ptorres.outsystemscloud.com/AppTestsWidget/Demo

I only did for text, date and number. Now You can understand and implement for the rest of Data Types.

The widget returns always in text dataType if not you will need many events, after you should convert in correct format.

Any doubt let me know.

Regards

AppTestsWidget.oml
UserImage.jpg
Shree harsha

I will try once, Thanks for your help 

2022-11-15 04-59-33
Piyush Sharma

Hi, Shree Harsha

you can create a form but in Reactive Application we don't have source property of form.

so we can bind the form's input field with the Aggregate's current property. If you want to insert the record for that add a filter in Aggregate and you can edit the Record as well.

If it is helpful for you.

Please mark as a solution!!

Thanks 

Piyush 

2023-08-28 07-00-10
Paulo Torres
Champion

You want a component totally dynamic? The fields will appears based on fields from your table?

You want to use for different tables, that's it?

UserImage.jpg
Shree harsha

Consider this sample table...

if a value is textbox i have to generate a textbox ..... if its a dropdown i have to generate a dropdown


2023-08-28 07-00-10
Paulo Torres
Champion

You should create a widget for that. Like this one:

You should receive the data type of your field and present the input correct, after you need an event to return what the user insert there.

Any doubt let me know

UserImage.jpg
Shree harsha
2023-08-28 07-00-10
Paulo Torres
Champion

You should create a WebBlock with this inside. Do you want a small demo?

UserImage.jpg
Shree harsha

How to create a web block that takes a input?

2023-08-28 07-00-10
Paulo Torres
Champion

Maybe it's better if I create something for you. But your WebBlock should receive an input parameter DataTypeId. Also you should create a static entity for that:

UserImage.jpg
Shree harsha

can you please explain the procedure to create a web block that takes a input and renders a ui element

2023-08-28 07-00-10
Paulo Torres
Champion

Yes, better to create a small app for you. Later on I can do it

UserImage.jpg
Shree harsha
2023-08-28 07-00-10
Paulo Torres
Champion
Solution

Hi @Shree harsha,

I prepared this code for you: https://ptorres.outsystemscloud.com/AppTestsWidget/Demo

I only did for text, date and number. Now You can understand and implement for the rest of Data Types.

The widget returns always in text dataType if not you will need many events, after you should convert in correct format.

Any doubt let me know.

Regards

AppTestsWidget.oml
UserImage.jpg
Shree harsha

I will try once, Thanks for your help 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.