on 02-15-2011 11:19 PM
Hi all,
I have a table with Multiple rows.
Table : XYZ
Row 1 : field1 X field2 Y field3 Z
Row 2 : field1 A field2 <blank> field3 C
Row 3 : field1 1 field2 2 field3 3
I am using Tables in the Adobe Form .
Based on the Above table data in Row 2 has a blank value in field 2.
So , I would like to delete that Row before displaying it on the Form using Script Editor.
I have Tried using this.rawValue = "hidden". but didnt work.
can anyone suggest a solution Please.
Thanks.
Tk
Hi,
You can solve this problem with javascript code. Try the following script in the appropriate event.
var tab1 = xfa.resolveNodes("MainForm.SubForm1.Table[*].Row[*]");
var tab_len = tab1.length;
for (var i=0; i<tab_len; i++)
{
var val = tab1.item(i).Field2.rawValue;
if (val == "" || val == null){
tab1.item(i).instanceManager.removeInstance(1);
}
}
This will solve your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai,
I just typed script in the thread and didn't tested it.
Anyway, Thank you for pointing it out. But now I feel there is one more mistake with that script. It will work fine if only one row has a blank field. If there are more than one row with blank fields, then it will give you a javascript error (index out of bound).
I think when we remove the row instance in a for loop, the index gets changed. So when you loop the table it has to be in the reverse direction. Here is the revised script.
var tab1 = xfa.resolveNodes("MainForm.SubForm1.Table[*].Row[*]");
var tab_len = tab1.length;
for (var i=tab_len-1; i>0; i--)
{
var val = tab1.item(i).Field2.rawValue;
if (val == "" || val == null){
tab1.item(i).instanceManager.removeInstance(i);
}
}
Thanks & Regards,
Sanoosh
Edited by: Sanoosh P K on Feb 16, 2011 11:02 AM
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.