Skip to Content
avatar image
Former Member

How to access Table rows in ADOBE form

Hello Experts,

I want to access the Table rows which are getting populated by WDA context, in form JavaScript when the table is populated.

on the basis of few cell values i want to disable and enable particular cells in table rows when the table is rendered to the user.

Please provide your inputs and suggestion on how to write a java script for it and in which event i should write the script.

i searched SDN and found couple of blogs and threads and tried using them but not working.

Thanks,

Siddharth

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jun 04, 2010 at 08:03 AM

    1) you need to see the data coming from the backend to your form

    2) you must write your script and user proper addressing, example:

    you place the script on the row subform level, you write like

    var help_var = this.yourfieldname.rawValue;

    this.field2.rawValue = help_var;

    this means the subform, where the script is placed (or field if you would place it on the field level)

    you can use parent pointer to access the node one level up from your position in the form hierarchy

    something like this.parent (where this means row, then this.parent means the subform for table).

    Examples available here (last chapter):

    http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf

    Regards Otto

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2010 at 08:48 AM

    Hi

    To access the rows of your table in the context, try to use the below syntax :

    var fields = xfa.form.subform.table.row.all;

    for (var i=0; i<=fields.length; i++ )

    {

    • do your code here

    }

    NB: It is always better to do all manipulations to your table in the back end.

    Regards,

    Deepa

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2010 at 09:18 AM

    Hello All,

    thanks for your suggestions.

    after some research and trial and error i found the solution:here is the sample code for those who might face this issue.

    SUPERNODE(Root Node)

    --SUBFM(SUBFORM)

    -


    MYNODE( Table)

    -


    DATA(Table ROW)

    -


    ADD (Table COLUMNS)

    -


    DELETE (Table COLUMNS)

    var data1;

    var norows = xfa.resolveNodes("SUPERNODE.SUBFM.MYNODE.DATA[*]").length;

    for ( var i =0; i < norows; i++)

    {

    if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").rawValue == "")

    {

    xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").access = "readOnly";

    }

    if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").rawValue != "")

    {

    xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").access = "readOnly";

    }

    }

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2010 at 04:24 AM

    Hello Experts,

    Any suggestions inputs are most welcome.

    Thanks,

    Siddharths

    Add comment
    10|10000 characters needed characters exceeded