Skip to Content
avatar image
Former Member

visibility of subforms

Hello,

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

    Hi,

    I hope this blog might be useful...

    /people/juergen.hauser2/blog/2006/01/31/access-mode-and-presence-of-fields-on-adobe-interactive-forms

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

    Regards,

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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      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") {

      subform1.presence="visible";

      subform2.presence="hidden";

      }

      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