Skip to Content
avatar image
Former Member

visibility of subforms


how can I dynamically change the visibility of a subform during runtime, depending on the type of enduser?

can you please give me a code example?

thank you for your help!

Best regards, Patrick.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Aug 11, 2006 at 02:14 PM


    I hope this blog might be useful...


    There is an property PRESENCE for subform where you can set the VISIBILITY. I hope you can try out.


    <i><b>Raja Sekhar</b></i>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member


      there are two things you could do.

      1. Bind both subforms to data nodes that are present or not present depending on the user. Check "Repeat subform for each data item" for both subforms. This means that a subform only appears on the form if the data node is present in the data stream.

      2. Use a script where you set the presence property according to the value of a data node. The script is one if-statement where in the then-branch one subform is set to visible and the other to hidden and in the else-branch vice versa.

      if (xfa.record.node.value=="usera") {




      Node is the name of the data node. And the expression to access subform1 and subform2 may differ for your form.

      I recommend the first approach since it is a data-driven approach without scripting.

      Best regards

      Juergen Hauser