Skip to main content
January 17, 2016
Answered

Name to display as first in custom dialog popup list

  • January 17, 2016
  • 1 reply
  • 2217 views

Hi Forum.

Thanks for the support so far.  I'm creating a simple custom dialog which will "popup", few names in dropdown.

I'm reading an external txt file which will have the name matching to the dropdown list. i'm trying to display the matched name "Stephen" in the txt file as first and then other follows one by one. Please help on this.

//name listed in popup

dialog.load({

names:

{

"King":-1,

"Queen":-2,

"Jack":-3,

"Stephen":-4,

"Robert":-5,

}

})

//it tried as below but found the variable myList3 is directly listed instead of its value ("Stephen").

dialog.load({

names:

{

myList3 :+1,  // the variable myList3 will have the name "Stephen" stored in it.

"King":-1,

"Queen":-2,

"Jack":-3,

"Stephen":-4,

"Robert":-5,

}

})

Much appreciated your timely help on this. thank you.

This topic has been closed for replies.
Correct answer try67

HI try67.

Thanks for the immediate reply and patience.

Any sample code to check the value of the assigned variable through scripting, because sources/links are available for only "forms and fields" but not for "custom dialog" dropdown values...

thank you very much..... It's really a great support indeed from you.


Check out examples 3 and 4 in the API reference of execDialog.

1 reply

try67
Community Expert
Community Expert
January 17, 2016

First of all, the id of an element in your dialog object must be exactly 4-characters. Not more, not less. So "names" is not a valid id value.

January 17, 2016

Hi try69... thanks for your support.


Now i have changed it to "wkt2", please guide me further on my request...as i can't able to get the value stored in myList3.


dialog.load({

wkt2:

{

myList3 :+1,  // the variable myList3 will have the name "Stephen" stored in it.

"King":-1,

"Queen":-2,

"Jack":-3,

"Stephen":-4,

"Robert":-5,

}

})

Thank you very much.

try67
Community Expert
Community Expert
January 17, 2016

It's hard to help you further without seeing the full code, or at least the definition of myList3... I would suggest you go back to the first piece of code and change the value of "Stephen" to +4 (and the id value to a valid one). I think that should work. You can then use that to declare your list variable correctly.

And it's try67, not try69...