437
Views
12
Comments
How to create dynamic input field
Question
Hello everyone.

how can i create a dynamic input field ?
i need to create some input's fields according with a result from an action.

i.e.: if returns 5, i need to creat 5 input fields, and if returns 10, i need 10 input fields.

i doenst know the returned number from the action, so i need the make some how , a dynamic imput field....

i'm trying to use javascrtip


function add() {
var e4 = document.createElement('input');
e4.setAttribute('type', 'text');
e4.setAttribute('size', '50');
return e4;
}


but it ain't return any result..

can someone help me ?
thanks
best regards

Bruno rebelo
2020-03-05 15-52-45
André Vieira
Staff
Hello Bruno,

First of all welcome to out community.

You can achieve this by creating a record list with a variable of the type you want. So if your action returns 5 all you need to do is to create a record list with a structure with the parameter of the type you want and append it to the record list 5 times. Then put this record list in a tablerecord and put an input field assign to the recordlist variable.

If this is too confusing I'll try to post here a sample when I have more time ;)
Nevertheless I hope this helps you.
Cheers,
André
UserImage.jpg
BR
hummmm
i thing i understand what you mean... i do the same with ListRecord and Table Records..

let me try.... but if you can get me the sample.... it would be great.

thanks for the atencion. :)
Best Regards
Bruno Rebelo
UserImage.jpg
BR
hello André.
i'm trying to resolve the problem, but didnt get there yeat.. so could you please put the sample? :p
it would be greast....


:)
Best Regards
Bruno Rebelo
2020-03-05 15-52-45
André Vieira
Staff
Hi Bruno,

Find attached the example eSpace. Hope this is what you want.
Cheers,
André
MultipleInputs.oml
UserImage.jpg
BR
Hello André,

thanks for the help.
its solved my problem. :)

Thanks
Best Regards
Bruno Rebelo
UserImage.jpg
Sunny Pathai
André Vieira wrote:
Hi Bruno,

Find attached the example eSpace. Hope this is what you want.
Cheers,
André
 Hi i am not able to open the OML file as it is too old. Can u update your example so thst i can run it in 9.0.1 version of outsystems
 
2012-08-04 21-41-02
Alexandre Costa
Hi folks, I need something like that, but in my case I have two record lists, one with groups and other with items of groups. How can I do that, because I can't put one table record inside another. Thanks.
2022-11-12 11-28-30
Gonçalo Martins
Staff
Alexandre Costa wrote:
Hi folks, I need something like that, but in my case I have two record lists, one with groups and other with items of groups. How can I do that, because I can't put one table record inside another. Thanks.
 
Hello Alexandre,

It's true that you can't put a table record inside another..
However you can put a WebBlock inside a table record and, that WebBlock can contain a table record..
So, you can do exactly what you want with the solution given by André joined with the tip I just gave you..
Good luck ..

Kind Regards,
Gonçalo Martins
2012-08-04 21-41-02
Alexandre Costa
Hello Gonçalo, thanks I use your sugesttion and work's like a charm. 
2022-11-12 11-28-30
Gonçalo Martins
Staff
Hello Alexandre,

Good to know that it helps...

Cheers,
Gonçalo Martins
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Hi Sunny,

Here's an upgraded version. Note that I didn't check whether it still works.
MultipleInputs_v9.oml
UserImage.jpg
Rupesh Wani

Hi Kilian, 

In my case I need to calculate the total of the score. (I have provided one attribute as integer in my structure) I want to calculate the total runtime. Can you please tell me, How I can achieve this? Sharing the OML as well.

Thanks 

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