cancel
Showing results for 
Search instead for 
Did you mean: 

How to Color a particular table row in adobeform ?

Former Member
0 Kudos

Hi Guys,

  I want to know, how to color a complete row of a table based on some condition in adobe form...

I achieved coloring a particular cell in the table of adobe form through the below java script,

if (<condition>) {

this.border.fill.color.value = "200,200,200";

}

But not able to color the complete row, plz help me out...

Accepted Solutions (1)

Accepted Solutions (1)

rakesh_m2
Contributor
0 Kudos

Hi Avinash,

You can use same condition and script for all the fields in the table right?  Are there more fields in the table?   can you please try 'Alternate row shading' in table properties.  Please be careful while changing code for alternate shading.  Documentation says, not to change it.  Check the logic used in it and use it accordingly, based on your condition.

--

Rakesh

Former Member
0 Kudos

Hi Rakesh,

   Actually i have to color the entire row, based on the data in field1 of the row, and so i can't keep condition on all the other fields of the row.

   And alternate shading doesn't serve my purpose, as i only want that particular rows which satisfy the condition to be colored.

Former Member
0 Kudos

Hi Avinash,

Okay. Alternatively, do this.

if (<condition>) {

this.border.fill.color.value = "200,200,200";

<<othersfield1>>.border.fill.color.value = "200,200,200";

<<othersfield2>>.border.fill.color.value = "200,200,200";

..

<<othersfieldN>>.border.fill.color.value = "200,200,200";

}

I am not sure the color changed will affect the subsequent row or not. If yes, you might need to revert the color back to normal using else statement. I assume normal color is white which has value 255,255,255

else{

this.border.fill.color.value = "200,200,200";

<<othersfield1>>.border.fill.color.value = "255,255,255";

<<othersfield2>>.border.fill.color.value = "255,255,255";

..

<<othersfieldN>>.border.fill.color.value = "255,255,255";

}

regards,

Xiang Li

Former Member
0 Kudos

Hi Xiang Li,

I had already tried this way with the below code.

if (this.rawValue == '1' ){

this.border.fill.color.value = "200,200,200";

data.MAIN.IT_KRA_DATA.DATA.WEIGHT.border.fill.color.value = "200,200,200";

data.MAIN.IT_KRA_DATA.DATA.TEXT.border.fill.color.value = "200,200,200";

}

But itz coloring the entire row only for the first record, and for all the other rows where the condition

satisfies, it is coloring only the first field of the row as shown in screen shot below,

rakesh_m2
Contributor
0 Kudos

Hi Avinash,

Using single field, you could set the properties of other fields also, by accessing as mentioned by Xiang. 

--

Rakesh

Former Member
0 Kudos

Hi Avinash,

I suspect your something wrong with your referencing. Can you please screen shoot your hierarchy on your form object?

Or, remove "this.border.fill.color.value = "200,200,200"" and test again, to check if your subsequent coding is working or not.

if (this.rawValue == '1' ){

data.MAIN.IT_KRA_DATA.DATA.WEIGHT.border.fill.color.value = "200,200,200";

data.MAIN.IT_KRA_DATA.DATA.TEXT.border.fill.color.value = "200,200,200";

}

Thanks.

regards,

Xiang Li

Former Member
0 Kudos

HI xiang,

I did coding according to above given logic. But, it i didnt do anythng to my output.NO CHANGE.

And, my code is :

                

if (this.rawValue == '**End of Income**' ){

data.I_TABLE.BodyRow.TEXTS.border.fill.color.value = "200,254,254";

}

Can you help me to solve this?

Thanks in Advance,

karthik

Answers (3)

Answers (3)

Former Member
0 Kudos

HI ,

I did coding according to above given logic. But, it didnt do anythng to my output.NO CHANGE.

And, my code is :

               

if (this.rawValue == '**End of Income**' ){

data.I_TABLE.BodyRow.TEXTS.border.fill.color.value = "200,254,254";

data.I_TABLE.BodyRow.BUKRS.border.fill.color.value = "200,254,254";

data.I_TABLE.BodyRow.RP.border.fill.color.value = "200,254,254";

}

Can you help me to solve this?

Thanks in Advance,

karthik

Former Member
0 Kudos

Hi Karthik,

Sorry i do not have AdobeLifecycle setup to tell you how exactly you can do it.

But I do remember there is a setting table's body row to populate alternative color for body row.

I would suggest to setup table using wizard, at body row page, you can select to have alternative color.

Once the table added on screen, refer the client side script and reuse them in your own table.

Hope this help. THanks.

regards,

Xiang Li

Former Member
0 Kudos

Hi Rakesh/Xiang Li,

Thanks for your help.

What Xiang said was right, i placed the code at field level instead of row level. So could not achive it.

But now corrected it and itz working...

Thank u....

Former Member
0 Kudos

Hi Avinash Palavai,

Glad to hear your issue been resolved.

Thanks for the rewards.

regards,

Xiang Li

0 Kudos

Hello all. I have the same problem. I would like to know in which event you put the javascript code.

I have tried in event "initialize" of row element but only works in row 1.

I have three visible fields in row and I need set property font.weight = "bold" based in the value of other invisible row field.

Please help !!!!

Thanks in advance.

Kiko

Former Member
0 Kudos

Hello Xiangli / Avinash,

I have a requirement where subtotals row in a table should be coloured yellow to differentiate between the rows.

I understood that some javascript logic needs to be written.

In my case to recognise the subtotal row in a table everytime, the fields XBLNR,PO_NUMBER AND FAEDT will always be empty. Therefore I have written the logic as below. I have written this logic at Row level in Intialize event in Java script.

if (( this.XBLNR.rawvalue == null ) && ( this.PO_NUMBER.rawvalue == null ) && ( this.FAEDT.rawvalue == null ))

{

     this.border.fill.color.value = "200,200,200";

}

But after writing this code, there is no change in the output. If I remove the If condition and write only the statement this.border.fill.color.value = "200,200,200";, then it is working, but here the colour will apply for all the rows as i didnot give any condition.

Could you please help me how to achieve this ? Please let me know if there is any wrong in my IF condition statement.

Thanks and Regards,

Karthik Ganti.

Former Member
0 Kudos

Hi Avinash,

I guess you are trying to change certain row based on condition, but to show alternative color between rows.

Instead of putting your code in each cell.

Can you move your code one level up to table row?

Example, if your code is under this element

data.Main.RecruitmentTeam.Table1.Row1.Name1

Move it to

data.Main.RecruitmentTeam.Table1.Row1

regards,

Xiang Li