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

Table search function

scottsheck
Registered: May 3 2007
Posts: 138

In Livecycle 8, I have a table with many rows which I'm using as a lookup table. Does anyone know if there is a javascript function that will search a single column of a table and return me the row number of that table?

thanks
Scott

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In LiveCycle Forms there's not such thing as a "Real" table. You can make something look like a table by stacking up and formatting subforms to look like a table.

So the answer is no, there is no built-in fucntion for looking up data in a table.

But, you can write your own function. The first thing to do is to look at how the pseudo-table is setup by examining it in the Hierarchy Window. The table will be a regular structure of subforms and text fields. Make sure everything is named. Use this info to dynamically build the SOM path you will need to access any element. If the text fields are given unique row/column names, then the easiest solution is to use the "resolveNode" fucntion to search for just the text field name.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

scottsheck
Registered: May 3 2007
Posts: 138
I'm not sure what you mean by 'real table'. In livecycle, there is a menu option named Table, and a submenu 'Insert table'. This certainly seems like a table to me.
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi scottsheck,

Yes, it looks like a table from the user point of view- but did you look in the Hierarchy window as Thom suggested to see how it was built structurally by stacking groups of sub-forms together? You need to look at it from a bottom level view, not from the user view, regardless of the label it's given in the LCD menus.

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
scottsheck
Registered: May 3 2007
Posts: 138
Thanks everyone. I see what you mean now, they both can have repeating rows. But having this unique feature could still give the ability to have a function. For instance, in formcalc, you can call the function:

Oneof("loan", Rows[*])

which will return a true if one of the rows contains that text. So it's not too far of a stretch to return which row it was especially since it's just basically an array its' searching.