Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

listbox focus

Contributor ,
Sep 20, 2015 Sep 20, 2015

main();
function main()
{
     var w = new Window ("dialog","test");
    var Columns = w.add("group"); Columns.spacing=0;
    var Header = {numberOfColumns: 1, showHeaders: true, columnWidths: [50]};
    Header.columnTitles = ["month"];
    var Col = Columns.add ("listbox", undefined, ["1","2","3","4","5","6","7","8","9","10","11","12"], Header);
  
    Col.preferredSize = [65,85];
    Col.selection = 8;
    Col.revealItem(8);

   
    w.show();
}

revealItem does not apply.

Where I went wrong?

Thanks for help.

TOPICS
Scripting
530
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Sep 21, 2015 Sep 21, 2015

Instead of:

Col.revealItem(8);

try:

w.onShow = function(){Col.revealItem(8)}

The onShow event is activated when the window is shown, and only then do you try to select item 8, and then it works.

Why this should be the case with the new SciptUI engine is another question, but if this were the only problem with it...

Translate
Engaged ,
Sep 21, 2015 Sep 21, 2015

MY first thought was that you try to reveal an item before the dialog is built.

But then I copied your code into the ESTK and it worked just fine.

Bildschirmfoto 2015-09-21 um 09.26.47.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 21, 2015 Sep 21, 2015

Hi,

This is works in InDesign 5.5 version . but CC2014 not works.

It needed another source?

  <- CC 2014

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Sep 21, 2015 Sep 21, 2015

Instead of:

Col.revealItem(8);

try:

w.onShow = function(){Col.revealItem(8)}

The onShow event is activated when the window is shown, and only then do you try to select item 8, and then it works.

Why this should be the case with the new SciptUI engine is another question, but if this were the only problem with it...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 21, 2015 Sep 21, 2015
LATEST

Thank you !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines