on 08-26-2014 2:25 PM
Hi,
I have a table which will have 4 rows only.I want to color the text of the first row in RED, 2nd in Yellow and 3rd in Green. How can read the table record dynamically and set the color? i mean What should be the scripting code to read the row number to set the color. I know i can create a table with 4 static rows and at each individual cell i set the color as per the need.But i am trying to access the row dynamically to set the color. Pls Help.
Thanks,
Pavan.
hi
you can read or modify cells like this:
Table.Row.YOURFIELDNAME.fontColor
for your dynamic coloring requirement, you can use while of FOR Expressions like this:
for variable = start expression
(upto | downto ) end expression
(step step expression ) do
expression list
endfor
example of code with WHILE would be like this:
var i=0
while (i ne "3") do
if (i eq "1") then
Table.Row[i].fieldname.fontColor = "color"
elseif (i eq "2") then
Table.Row[i].fieldname.fontColor = "color"
elseif (i eq "3") then
Table.Row[i].fieldname.fontColor = "color"
endif
i = i + 1
endwhile
for color codes in adobe refer to here:
http://http://help.adobe.com/en_US/livecycle/9.0/designerHelp/001103.html
however when you say you want to change first three rows i think its not dynamic anymore, but i hope these codes helps you,
Ali,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ali,
Thanks for the Reply. Can i use a single statement to color the text of the entire row instead of setting color at each field level.
I am trying with below code but it is not working. I coded this in INITIALIZE event of the Table.
var i=0
while (i ne "3") do
if (i eq "1") then
Table.Row[i].fontColor = (255,0,0)
elseif (i eq "2") then
Table.Row[i].fontColor = (255,255,0)
elseif (i eq "3") then
Table.Row[i].fontColor = (0,128,0)
endif
i = i + 1
endwhile
Hi
i suggest you to download following pdf files from Adobe, this is a scripting guide for java and formcalc, gives you a lot of ideas for your scenarios:
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf
help.adobe.com/en_US/livecycle/es/FormCalc.pdf
Indeed, that lines of code may not work for 2 reasons, first of all how you set the event language? formcalc or JavaScript? Secondly, you may need to use this code in FormReady event since in initialize event your table may not filled yet. and lastly if you are not experienced in java ask someone to check whether your code works fine or it may need a little bit of changes.
Your point highly appreciated,
Ali,
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.