How to create dynamic input field

How to create dynamic input field

  
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
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é
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
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
Hi Bruno,

Find attached the example eSpace. Hope this is what you want.
Cheers,
André
Hello André,

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

Thanks
Best Regards
Bruno Rebelo
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.
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
Hello Gonçalo, thanks I use your sugesttion and work's like a charm. 
Hello Alexandre,

Good to know that it helps...

Cheers,
Gonçalo Martins
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
 
Hi Sunny,

Here's an upgraded version. Note that I didn't check whether it still works.