Copy link to clipboard
Copied
I have a complex panel, and am trying to jump straight to an edittext when a radiobutton is clicked.
Greatly simplified:
box.groupButton.onClick = function ( ) { box.groupEdittext.active = true };
box.groupEdittext reports as active when tested in the long version of the above function, but neither shows as having the focus nor has the cursor placed in it.
I've also tried:
box.groupButton.addEventListener ( 'click', function ( ) { box.groupEdittext.active = true } );
with the same (non) effect.
Elsewhere:
box.groupEdittext1.onActivate = function ( ) { box.groupEdittext2.active = true };
(which is the closest to an onClick event as one can get with edittext) works as expected (albeit not a lot of use), putting the focus on box.groupEdittext2and placing the cursor in it.
Changing the radiobutton to a checkbox effects no change in behaviour.
Any ideas how to achieve this simple jump very much welcomed, or is it impractical/impossible? Or am I too stupid to see the blindingly simple error/solution?
Copy link to clipboard
Copied
box.groupButton.onClick = function ( ) { box.groupEdittext.active = true };
In CS6, everything works great. In CC (2018), as always, nothing works.
Use this method
var d = new Window("dialog")
var r1 = d.add("radiobutton", undefined, " R1");
var r2 = d.add("radiobutton", undefined, " R2");
var dummy = d.add("statictext", undefined, "");
var t1 = d.add("edittext", undefined, " 11111111111111");
r1.onClick = function() { dummy.active = true; t1.active = true; }
d.show()
Copy link to clipboard
Copied
r-bin, thanks, but the existing full code of the box.groupButton.onClick function already makes a statictext active. So no joy.
PS: I should have said, CC2019 (20.0.1) on Win10. I'll check tomorrow (UK) on Mojave and revert if that is any different.
Copy link to clipboard
Copied
Understood nothing.
So does it work for you or not? What exactly is the problem?
Copy link to clipboard
Copied
Duh!
I said it was a complex panel, with a lot of code. In testing this morning, I observed that a statictext box was being changed under certain infrequently occurring circumstances. Detailed investigation then revealed two variable names which differed only in the classic "Zero/Oh".
Fixed that and the a/m problem vanished.
Thanks to all for thinking through the issue, and especially to r-bin.
Copy link to clipboard
Copied
Grimbaldus
I did not understand what you want exactly
if you can be more specific
can not you post the source code?
Copy link to clipboard
Copied
geppettol66959005, apologies if my question was not clear enough. I thought it was simply put.
And no, I was not going to post the entire source code, it's tens of thousands of lines long, in hundreds of interrelated functions.
Regardless, I have solved the issue.
Copy link to clipboard
Copied
Me too, so like yestarday I couldn't understand what that guy wants: Detect clipping path when pasting imagine
Copy link to clipboard
Copied
Kukurykus, apologies if my question was not clear enough. I thought it was simply put.
Regardless, I have solved the issue.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more