Page 1 of 1

Clearing contents of a table (RDMLX)

Posted: Thu May 10, 2012 6:56 am
by tcremieux
Is there a way to clear the contents of a table without having to refresh the entire form? I was thinking that calling #COM_OWNER.SetTable again would rebuild the table. Ideally this would be something like #COM_OWNER.ClearTable Name('Table').

Currently, the only way I can achieve this is to specify #COM_OWNER.IsNewForm = True, which however clears the contents of any textbox on the form.

Thanks!

Re: Clearing contents of a table (RDMLX)

Posted: Thu May 10, 2012 3:16 pm
by Paul
Thanks for posting this Tom. The way to clear a table using current beta versions would be to set the Row property to null. The Row property is not directly exposed in the LRNG_FORM ancestor but it can be accessed. Please try the following;

Code: Select all

#COM_OWNER.Set_Null Property('/Form.Fields.Table1.ROW')
There will be an RDMLX method or feature of Tables to do this in the future.

Note this post is for RDMLX LongRange Form views only.

Re: Clearing contents of a table (RDMLX)

Posted: Thu May 10, 2012 3:18 pm
by Paul
I should add that 'Table1' will be replaced with the actual name of your table.

Re: Clearing contents of a table (RDMLX)

Posted: Fri May 11, 2012 2:16 am
by tcremieux
Thanks Paul. I used the Set method to set the ROW property to *NULL since there is no Set_Null. Works perfect.

Code: Select all

#COM_OWNER.Set Property('/Form.Fields.Table1.ROW') To(*NULL)

Re: Clearing contents of a table (RDMLX)

Posted: Mon Aug 27, 2012 3:27 pm
by Paul
A new parameter, ClearRows, was added to the LongRange LANSA GA release. Set this parameter to True to clear all existing rows from a table before adding new ones.

For example;

Code: Select all

#COM_OWNER.Set_Table Name('/Form.Fields.Table1') Clearrows(True)