cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe forms: Hide table rows based on data

vallamuthu_madheswaran2
Active Contributor
0 Kudos


Hi Friends,

I've print the internal table data using adobe forms. In the internal table, there is a field called  "CHARG".

If charg field is not initial then row will be printed else hide the row.

In java script , which event we can use?

Regards,

Vallamuthu M

Accepted Solutions (0)

Answers (2)

Answers (2)

ChrisSolomon
Active Contributor
0 Kudos

Put this JavaScript code in the subform that contains your table (ie. one node above your table) in the "form ready" event (of course change the names/DOM paths to match your form)....

var valEmpty;

var numrows = xfa.resolveNodes("data.Mainpage.My_Table_Subform.Table1.Row1[*]").length;

for (var x=0; x < numrows; x++) {

     valEmpty = xfa.resolveNode("data.Mainpage.My_Table_Subform.Table1.Row1[" + x + "].CHARGE").rawValue

    if (valEmpty == "" || valEmpty == null) {

        xfa.resolveNode("data.Mainpage.My_Table_Subform.Table1.Row1[" + x + "].CHARGE").presence = "hidden";

    }

}

pavan_prabhu
Active Participant
0 Kudos

Hi Vallamuthu,

     Click on DATA sub form of the table. In Initialize event write the Javascript below.

if ( this.CHARGE.rawvalue == "  " )

{

   this.presence = "hidden";

}

But I suggest you to do it in the Interface level using ABAP since this increases performance. You just need to use one statement as below.


DELETE i_tab where charge IS INITIAL.

Here i_tab is the internal table.