These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to set the contents of a table cell via script

KathrynGZ
Registered: Apr 15 2008
Posts: 35

I need to change the contents of a table cell based on which radio button a user clicks. But I can't find the syntax to do this! Here's what doesn't work, and the error message I get

cell1 = "some text"
Error:setRawValue is an unsupported operation for the exData object

cell1.rawValue = "some text"
Error:setRawValue is an unsupported operation for the exData object

cell1.value = "some text"
Error:Invalid property set operation; value doesn't have a default property

cell1.text = "some text"
Error:accessor 'cell1.text' is unknown.

cell1.value.text = "some text"
Error:accessor 'cell1.value.text' is unknown.

When none of those things worked, I tried using the syntax that sets the caption of a field: cell1.caption.value.text.value. Strangely, this *does* insert text in the table cell, but it inserts the text *in addition* to what's already there. I need to *replace* what's already there.

So I have two questions: 1) Can anyone tell me the right syntax, and 2) Where could I have found this information, if anywhere? I checked LCD help and googled for an answer, but didn't find anything.

Thanks!

Kathryn

My Product Information:
LiveCycle Designer, Windows
scottsheck
Registered: May 3 2007
Posts: 138
Are you using Livecycle?
KathrynGZ
Registered: Apr 15 2008
Posts: 35
Yep.
Helen_Dyksley
Registered: Jun 4 2007
Posts: 27
Kathryn, try this JavaScript on the Change event. I created a Text object in the cell. This was created in Designer 7.1 and tested in Reader 8.1. Also this is saved as a Dynamic pdf. If Yes is selected, changes the current text to "Change" and if No is selected, changes the text to "Works".


if (RB.rawValue == 1) {
Table1.Row1.Cell1.value.resolveNode("#text").value = "Change";
}
else if (RB.rawValue == 2) {
Table1.Row1.Cell1.value.resolveNode("#text").value = "Works";

}
scottsheck
Registered: May 3 2007
Posts: 138
It's even easier in Formcalc since the syntax is less cryptic. Try:

Table1.Row1.Cell1="Change"

Table1.Row1.Cell1.rawValue="Change" works also.

Most importantly, you must have the upper and lower case exactly as shown, since case matters.