I
Ian Sedwell
Hi Guys
I am trying to use JavaScript in Acrobat. It is a very slow and frustrating
process and I kind of aet the feeling that the guys at Adobe thought that it
would a cool thing to have, but then lost interest before they had properly
sorted the thing out.
My current vexation is trying to obtain the last item clicked in a ListBox.
My script is as follows (it is printing to the console for test purposes).
The script is attached to a mouseUp event in the ListBox field.
The trouble is it either always returns the last item in the list or it
always returns the value of the previous value that was clicked in the list.
So, if my list is "Red, Green, Blue, Purple", let us assume I first of all
click on Blue. Because this is my first click, it will return "Purple"
(seriously, there's no joke here). Now assume I click on "Red". This time it
will either return "Purple" or "Blue". If I click again, this time on
"Green", it will either return "Purple" or "Red". And so on...
var f = this.getField("Test");
var i = f.currentValueIndices;
Var n = f.getItemAt(i);
console.println("Name = " + n);
I have tested this in Acrobat 5 and 6 on MacOX X, Acrobat 5 and 6 on Windows
2000, Acrobat 5 on MacOS9 and Acrobat 6 on Windows XP. And I get exactly the
same result on all six combinations.
Doubtless, I am being very dumb and have missed a trick.
Any help will be greatly appreciated.
Why don't I submit this question to Adobe? Good question. I have. The better
question is why don't the buggers answer
Regards
Ian
I am trying to use JavaScript in Acrobat. It is a very slow and frustrating
process and I kind of aet the feeling that the guys at Adobe thought that it
would a cool thing to have, but then lost interest before they had properly
sorted the thing out.
My current vexation is trying to obtain the last item clicked in a ListBox.
My script is as follows (it is printing to the console for test purposes).
The script is attached to a mouseUp event in the ListBox field.
The trouble is it either always returns the last item in the list or it
always returns the value of the previous value that was clicked in the list.
So, if my list is "Red, Green, Blue, Purple", let us assume I first of all
click on Blue. Because this is my first click, it will return "Purple"
(seriously, there's no joke here). Now assume I click on "Red". This time it
will either return "Purple" or "Blue". If I click again, this time on
"Green", it will either return "Purple" or "Red". And so on...
var f = this.getField("Test");
var i = f.currentValueIndices;
Var n = f.getItemAt(i);
console.println("Name = " + n);
I have tested this in Acrobat 5 and 6 on MacOX X, Acrobat 5 and 6 on Windows
2000, Acrobat 5 on MacOS9 and Acrobat 6 on Windows XP. And I get exactly the
same result on all six combinations.
Doubtless, I am being very dumb and have missed a trick.
Any help will be greatly appreciated.
Why don't I submit this question to Adobe? Good question. I have. The better
question is why don't the buggers answer
Regards
Ian