cancel
Showing results for 
Search instead for 
Did you mean: 

Color the row based on condition

Former Member
0 Kudos

Hello all,

I am woring on an interactive adobe form being called by a web dynpro application.

The adobe form interface used is XML Schema based. The form displays some data at header level and item level.

The item details are displayed in a table. Now. my requirement is that i have a field 'STATUS' in the item table. I want to display the row with RED color if the STATUS = 'X' . How can i achieve this.. i tried using java script at Row initialze event but that didn' work.

Please let me know if you have some solutions.

Thanks & Regards,

Ravi Aswani

Accepted Solutions (0)

Answers (1)

Answers (1)

rakesh_m2
Contributor
0 Kudos

Try this code

var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);

var custordertext;

for (var i=0; i <= fields.length-1; i++)

{

if (fields.item(i).name == "STATUS")

{

if(fields.item(i).rawValue == "X")

{

this.fillColor = "50, 50, 255";

}

}

}

use this event in calculate event

Thanks,

Rakesh

Former Member
0 Kudos

You can try the below code at form:ready event of the form.

if (Statfieldname.rawValue == 'X')

this.parent.fillColor = '256,256,256'

endif

Thanks,

Aravind

Former Member
0 Kudos

Hi Rakesh,

I tried with the code you provided but after applying the code as Java Script the complete ITEM table gets colored . I need to color only those rows where the value of STATUS = 'X'. The test table i am using has 5 entries with status 'X' and 2 entries with STATUS = 'C'. All the 7 entries are displayed in colored rows. Can you please check .

Thanks & Regards,

Ravi Aswani

rakesh_m2
Contributor
0 Kudos

Hello Ravi,

Comparing value with X is little bit problem in javascript, as in I had the same problem. check whether the value is null or not.

change the condition and give it a try.

Thanks,

Rakesh.