Skip navigation
ubolrat
Currently Being Moderated

Action on subform?

Jun 9, 2012 4:11 AM

Can I add a action on a subform somehow.

 

In my form it depends what column you enter then some other columns should be disabled.

 

I can put a action on one field and get a subform disabled. But I can not put a action on a subform.

 

That means I have to put this action on so many fields it gonna take me one day to do it.

 

Is there a way to put a action on a subform or multiple fields?

 

/ Anders

Sweden

 
Replies
  • Currently Being Moderated
    Jun 10, 2012 12:56 AM   in reply to ubolrat

    Hi,

     

    It depends on what version of LC Designer you have AND what version of Acrobat/Reader that the users have.

     

    One method would be to propagate the event. See here: http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?conte nt=000018.html.

     

    You would place generic script in the exit event of the subform and enable propagation for that script. This would mean that the script would fire as the user exits any field within that subform.

     

    Please note that you would need to keep the script generic, so that for example this.rawValue would refer to the value of the field just exited.

     

    Also the form would need to be opened in Acrobat/Reader v9.1 or above, as event propagation is not supported in earlier versions.

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 12:07 AM   in reply to ubolrat

    Hi,

     

    You can add the propagation instruction in the XML Source, but proceed with caution.

     

    The latest version of LC Designer (v10), you can turn on the option for Event Propagation in the Tools > Options dialog:

     

    Parallels Desktop1.png

     

    I am not sure that you will get the propagation to work from the Action Builder. You may need to add the script yourself, directing into an appropriate event in the Script Editor.

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 3:31 AM   in reply to ubolrat

    Hi Anders,

     

    It is not a big/insurmountable step to create your own script, instead of using Action Builder.

     

    Let's say TextField1 is in the first column and TextField2 is in the second column. The following JavaScript in the exit event of the subform (propagated) should work:

     

    if (xfa.event.target.name === "TextField1") {
         if (xfa.event.target.rawValue === null) {
              var vRow = xfa.event.target.parent.index; 
              xfa.resolveNode("Row1[" + vRow + "].TextField2").access = "open"; 
         }
         else {
              var vRow = xfa.event.target.parent.index; 
              xfa.resolveNode("Row1[" + vRow + "].TextField2").access = "readOnly"; 
         }
    }
    

     

    Okay, it might seem a little involved and the script above will depend on your form's structure. But the message should be that it is possible.

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 5:54 AM   in reply to ubolrat

    Hi Anders,

     

    There is a working example here: http://assure.ly/LucDMf.

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 13, 2012 7:00 AM   in reply to ubolrat

    Hi Anders,

     

    Yes, it would be posible to extend the script, so that it loops through all of the rows. However I would need to see the structure of the form and whether the table contained a static number of rows or could the user add more rows.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 14, 2012 3:34 AM   in reply to ubolrat

    Hi Anders,

     

    Have a good look at this amended example: http://assure.ly/LWbvj8. It has the functionality you require, you just need to extend it to the number of objects in each row.

     

    Be sure to have a look at this discussion on SOM Expressions and xfa.resolveNode/xfa.resolveNodes: http://assure.ly/kUP02y.

     

    Hope that helps,

     

    Niall

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points