cancel
Showing results for 
Search instead for 
Did you mean: 

Create empty table UI Element for input - Not only 1 row wanted

Former Member
0 Kudos

Hi all,

I want to create an empty table UI Element for input. The maximum lines of the table is unknown.

I don't want to do so: first create 5 or 10 rows, and after these rows are filled, press a button to create another 5 or 10 rows...

I hope that the table could have an unlimted number of available rows, or just new rows are created automatically after exsiting rows filled.

Can I? How Can I?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Gangtee,

Create some number of empty elements (say 100) in Create().Call this in wdDoInit(). Then whenever you save the table call this Create() after successful save.

Implement Create() like this:

if (wdContext.node<tablenode>().isEmpty())

{

for (int i = 0; i < 100; i++)

{

//add 100 eleements

}

}

else

{

// show already saved nodes then add 100 more

for (int i = 0; i < 100; i++)

{

//add 100 eleements

}

}

regards,

siva

Answers (3)

Answers (3)

Former Member
0 Kudos

Dears,

I know my requirement is quite strange. Thank you very much for your ideas.

I finally took a way similiar with Manoj's:

Initially create 2 empty rows. At the atLeadSelection event handler, add a new empty row if there is not enough (e.g. 2 rows) empty rows.

Thank you.

Former Member
0 Kudos

Hi,

Another way to solve this problem.

Suppose you created 5 elements in init(). Set a context attribute createdRows to 5.

Now while entering the fields when user comes to the last row, then

int leadSelect = wdContext.nodeTable().getLeadSelection() ;(= 5)

Create another set of 5 elements of your table node when:

leadSelect = wdContext.currentContextElement().getCreatedRows();

then set the fresh created row count to your attribute:

wdContext.currentContextElement().setCreatedRows(

wdContext.currentContextElement().getCreatedRows() + 5);

thanks & regards,

Manoj

Former Member
0 Kudos

Hi,

Could you elaborate your requirements?

and if you want to load unlimited rows set visibleRowCount=-1

Regards

Saravanan K