Generate lines on a table
Question
Application Type
Reactive

Hi guys,


I have a doubt on an exercice I have to make.


Basically I have to create an input (integer) where I will put a number, and then I have to press a button to generate a table with the same amount of lines as I entered on the input.


Any idea on how to do it?


Thank you,


Tiago

Hi Tiago,

Do it with a list.

When you press the button run a cycle with an "If" statement like " If counter <= numberofrows"  and on each cycle just use the listappend action.

Then you'll be creating a list with x amount of rows.

Also don't forget to use list clear before running the action again so that you start the cycle on a fresh list.

Hi Luis,


But in this case I am using a local variable with a list type but empy, so I cannot go for the count.

So, you have an input where the user specifies a number and then a button is pressed. The button has an action associated to it.

Lets say the input has the "numberofrows" associated to it.

On the action you have a counter variable that'll go from 1 to numberofrows and in each iteration you do a listappend effectively creating 1 row at a time.

Here's an oml.

Hope it helps! Cheers!


ListRowGen.oml

Hello Tiago,


You can try using the table's maxrecord, can't you? I send you the oml file with an example, where you have the input, a submit button and a listing.


Regards,

Jorge Rodrigues

MaxRecords.oml

Hi Jorge,


In this case I am not using any table, I just wan't to create the lines

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