Expand my Community achievements bar.

Do Not Scroll on Expanding Form

Avatar

Former Community Member
I have a form where I expand several subforms. I've applied the do not scroll java script to the fileds on the subforms that will expand. The problem is that the expanded subforms lose the do not scroll ability. Is there any way to keep the expanded fields from scrolling?



Ken
6 Replies

Avatar

Level 6
This reminds me of a similar problem that I had once with tabbing order. Custom tabbing is not respected in dynamically generated subforms. I believe the issue was specific to a particular version of Acrobat or Reader. What version are you testing in?

Avatar

Former Community Member
I'm using Designer 7.0 (041126) and reader 7.0.8

Avatar

Former Community Member
Hi Ken. Try this script in the docReady event of the fields you want to limit the scrolling of.



var acroSOM = this.someExpression.substr(15, this.someExpression.length - 1);

var acroField = event.target.getField(acroSOM);

acroField.doNotScroll = true;



I hope this helps.

Avatar

Former Community Member
Okay. I think I figured it out...



You have to access the index of the parent and make it a variable index. So, it would look something like this...



var nindex = this.parent.index;

var myDoc = event.target;

var f = myDoc.getField("MainBodySubform[0].ContractsReceived[0].ContractDetail[" + nindex + "].Name[0]");

f.doNotScroll = true;



This will change the index value as the form expands and keep the Do Not Scroll working...



If you have a nested subform it would look like this...



var nnindex = this.parent.parent.index;

var nindex = this.parent.index;

var myDoc = event.target;

var f = myDoc.getField("MainBodySubform[0].Sub1[0].Sub2[" + nnindex + "].Info[" + nindex + "].Name[0]");

f.doNotScroll = true;



Of course, I hear in Version 8 this will be in the UI so hopefully none of this will be needed....

Avatar

Former Community Member
It looks like your solution will work, but doing it that way you'll need to alter the script for each specific field name. With the script I posted, you should be able to use it generically without calling out each field.

Avatar

Former Community Member
Thanks David. I'll try that. I see you posted right before I did. I wish I waited a few minutes. Then I would've seen yours first.



Thanks again...