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

How to make a clickable object that expands/contracts a read-only text block like a web page

SeattleUser
Registered: Nov 21 2008
Posts: 108
Answered

Is it possible to create a line of text that, when clicked, it will expand to show more information on that subject, and when clicked again, it will hide that information again?
 
Windows XP SP3

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Accepted Answer
Hi,

you can do this with a text field.
Simply put this script in the mouseEnter:event...

  1. this.minH = "10mm";
  2. this.h = null;
  3. xfa.layout.relayout();
... and this into the mouseExit:event.
  1. this.h = "10mm";
  2. this.minH = null;
  3. xfa.layout.relayout();
Here's a sample file for you:
Sample

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

SeattleUser
Registered: Nov 21 2008
Posts: 108
Radzmar, that's sort of what I'm looking for. Thanks for the code. I just can't get it to work? It appears the same as your sample with the + symbol and everything, but when I hover over it, it doesn't expand. I was going to try to look at your code but that PDF is locked.

In any case, maybe you can tell me: if there were another field directly below the expandable one you created, would the PDF content flow? Or would they just overlap? The effect I'm going for is dynamic flow, not overlapping.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
? Not sure what you mean, the file isn't locked in anyway!

You have to open the file in Designer to see how it's built.

To answer your 2nd question.
You can design the flowable, so the content below won't be overlapped.
I updated the sample file to show you how.

New Sample File

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

SeattleUser
Registered: Nov 21 2008
Posts: 108
Ah! My bad. Stream of consciousness workflow - I was originally going to post this in the Acrobat Pro Forms section and had forgotten I put this in LiveCycle...so I was trying to do this in Acrobat Pro! I got it to work fine in LiveCycle, however.

However, it appears that the updated file is identical to your first file? I copied the text field and pasted it below the original and, when opening it in Acrobat and hovering over the first field, it does indeed overlap the second field which is what I'm trying to avoid. Did I miss something again?!
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Nope, was my fault.
Try again, the sample now is the new one.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

SeattleUser
Registered: Nov 21 2008
Posts: 108
Great - thanks! That works. I'll see if I can work that into my current project. Much appreciated!