on 07-02-2013 2:00 PM
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...
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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,
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.