When I open a new window (an alert box, another scriptUI window, or an old style InDesign dialog) from my non modal ScriptUI interface, the contents inside all tabs on the tabbedpanel of the window disappear completely, and the last tab is selected.
Other controls, outside the tabbed panel (but in the same window) are left untouched.
I suspect the error has to do with the tab control. I have been able to recreate the error in an extremely simple window, and I attach the code below.
#targetengine 'test'
var Window1 = new Window('palette','Test',undefined);
buildWindow();
Window1.show();
function buildWindow(){
Window1.tabMain = Window1.add('tabbedpanel',undefined,undefined);
Window1.tabMain.minimumSize= [450,170];
Window1.tabMain.Tab1 = Window1.tabMain.add('tab',undefined,"Tab 1");
Window1.tabMain.Tab1.Static1 = Window1.tabMain.Tab1.add('staticText',undefined,"Text on tab 1");
Window1.tabMain.Tab2 = Window1.tabMain.add('tab',undefined,"Tab 2");
Window1.tabMain.Tab2.Static1 = Window1.tabMain.Tab2.add('staticText',undefined,"Text on tab 2");
Window1.tabMain.Tab1.btnTest = Window1.tabMain.Tab1.add('button',undefined,"Test");
Window1.tabMain.Tab1.btnTest.onClick = function(){alert('btnTest_onClick')};
// Trying with calls to layout . (This button is not affected by the alert showing - only controls inside the tabbed panel)
Window1.btnLayout = Window1.add('button', undefined, 'Window1.layout.layout()');
Window1.btnLayout.onClick = function(){Window1.layout.layout()};
}
The interface works well in CS4, and also if I make the window modal (by creating it as a "dialog").
In CS5, the result is this:
Calling layout.layout() or layout.resize() doesn't do anything.
If someone else would like to try my code, do you get the same effect?
Is the behaviour known?
Is there a way to prevent this from happening for non modal ScriptUI windows?
Best regards,
Andreas Jansson
Thanks Marijan, for testing and letting me know!
I filed a bug report now. We would perhaps have to "force" a couple of our clients to an upgrade from CS5 to CS5.5 in order to beat this bug and get it working, unless Adobe acknowledges it quickly, which I don't count on.
No good news then... I took for granted that the interface would work in CS5 if I made it in CS4.
(The thing that I was mostly concerned about was a tree view which I tested in Mac/PC and on CS4/CS5. Not the "tabbed panel"...)
Andreas
Adding this answer I got from Adobe:
Monday, November 21, 2011 2:21:03 AM PST
Hello Andreas,
I was able to replicate this problem with InDesign CS5. This bug seems
to have already been fixed as a side effect of some code change within
InDesign CS5.5.
I have logged this under bug # 3050997. This will now be worked upon by
InDesign engineering and should be fixed soon.
I'll keep you informed about updates on this bug.
Message was edited by: Andreas Jansson. Response from Adobe added.
Great, I will implement this workaround unless Adobe releases their bug fix soon!
I got a mail three weeks ago, where they told me that a so called MA (Master Archive) patch will be released within about one month, and that this bug will be solved in that "MA".
But it's really a great little workaround you've found out. (I just wish it had been found last autumn, or that the Adobe technicians could have known about and sent me this tip at the time I reported the bug :-)
Thanks,
Andreas
North America
Europe, Middle East and Africa
Asia Pacific