Subscribe Bookmark RSS Feed

How to get display box reference from dynamically created display boxes

volf

Staff

Joined:

Jun 23, 2011

Hi,

I have a difficult question.

This JMP application is that the combo box can be added and deleted dynamically by user. Each combo box has line number containing in reference. Also, user can freely change any combo box.

My question is when user change one combo box, how to get the changed combo box reference.

I tried many kind ways. However, I didn't find correct way.

If you have any solution or idea, please let me know.

My source code is as below.

3 REPLIES
Unfortunately it doesn't seem to be possible to run the script as posted, which often seems to happen when scripts contain one or more of the following four characters: "[", "]", "<" and ">", as this one does. To bypass the problem, try reposting it after doing the following:

(a) Copy the formatted script into any word processor;

(b) Run a global search-and-replace on each of those four characters, replacing each one by its HTML code, a list of which you can find for example at http://www.ascii.cl/htmlcodes.htm . That is:

Replace [ by & # 9 1 ;
Replace ] by & # 9 3 ;
Replace < by & # 6 0 ;
Replace > by & # 6 2 ;

I've had to insert spaces in the codes in the lines above to prevent them from being transformed back again into ASCII characters in this post, but you should not include any spaces. Don't forget to include the semi-colons at the end of each one: the script will probably look very peculiar by this time, but persist anyway.

Once that's done, prefix the whole script with the following two lines:



(Just typing the above four lines here as I want them to appear has forced me to use HTML codes, which you'll be able to see if you try replying to this message using "Quote Original", but when following these instructions you should not use HTML codes here: just type what you can see above.)

(c) Finally, paste the script from the word processor back into the message box.

That should cause the script to display correctly with all its formatting. It's a bit of a pain, but it's the only way I know to get it right, unless anyone has any other suggestions.
mpb

Super User

Joined:

Jun 23, 2011

Another approach to posting JSL which retains formatting was described here by PMroz:
http://support.sas.com/forums/click.jspa?searchID=162884&messageID=38882
That's a very nice solution: I downloaded NVU for free, installed it, ran the following simple example through it and posted this all in less than 15 minutes:



style="font-size: 9pt; font-family: "Courier New"; color: black;">

 



style="font-size: 9pt; font-family: "Courier New"; color: black;">NumTabs

style="font-size: 9pt; font-family: "Courier New"; color: navy;">=

style="font-size: 9pt; font-family: "Courier New"; color: black;">

style="font-size: 9pt; font-family: "Courier New"; color: rgb(0, 0, 221);">function

style="font-size: 9pt; font-family: "Courier New"; color: black;">({}

style="font-size: 9pt; font-family: "Courier New"; color: navy;">,

style="font-size: 9pt; font-family: "Courier New"; color: black;">
{Default
Local}

style="font-size: 9pt; font-family: "Courier New"; color: navy;">,

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">      

style="font-size: 9pt; font-family: "Courier New"; color: green;">/*





style="font-size: 9pt; font-family: "Courier New"; color: green;">
style="">             
Function to determine the
number
of tab boxes in a chart window;





style="font-size: 9pt; font-family: "Courier New"; color: green;">
style="">      
*/

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">      
TabExists

style="font-size: 9pt; font-family: "Courier New"; color: navy;">=

style="font-size: 9pt; font-family: "Courier New"; color: black;">

style="font-size: 9pt; font-family: "Courier New"; color: teal;">0

style="font-size: 9pt; font-family: "Courier New"; color: navy;">;

style="font-size: 9pt; font-family: "Courier New"; color: black;">
TabCount

style="font-size: 9pt; font-family: "Courier New"; color: navy;">=

style="font-size: 9pt; font-family: "Courier New"; color: black;">

style="font-size: 9pt; font-family: "Courier New"; color: teal;">0

style="font-size: 9pt; font-family: "Courier New"; color: navy;">;

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">      

style="font-size: 9pt; font-family: "Courier New"; color: rgb(0, 0, 221);">while

style="font-size: 9pt; font-family: "Courier New"; color: black;">(

style="font-size: 9pt; font-family: "Courier New"; color: navy;">!

style="font-size: 9pt; font-family: "Courier New"; color: rgb(0, 0, 221);">is
missing

style="font-size: 9pt; font-family: "Courier New"; color: black;">(

style="font-size: 9pt; font-family: "Courier New"; color: black;">TabExists)

style="font-size: 9pt; font-family: "Courier New"; color: navy;">,

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">             
TabCount

style="font-size: 9pt; font-family: "Courier New"; color: navy;">++;

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">             
TabExists

style="font-size: 9pt; font-family: "Courier New"; color: navy;">=

style="font-size: 9pt; font-family: "Courier New"; color: black;">

style="font-size: 9pt; font-family: "Courier New"; color: rgb(0, 0, 221);">try

style="font-size: 9pt; font-family: "Courier New"; color: black;">(

style="font-size: 9pt; font-family: "Courier New"; color: rgb(0, 0, 221);">is
scriptable

style="font-size: 9pt; font-family: "Courier New"; color: black;">(

style="font-size: 9pt; font-family: "Courier New"; color: black;">ChartWindow[TabPaneBox(TabCount)]))

style="font-size: 9pt; font-family: "Courier New"; color: navy;">;

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">             
)

style="font-size: 9pt; font-family: "Courier New"; color: navy;">;

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">      
TabCount

style="font-size: 9pt; font-family: "Courier New"; color: navy;">-

style="font-size: 9pt; font-family: "Courier New"; color: black;">

style="font-size: 9pt; font-family: "Courier New"; color: teal;">1

style="font-size: 9pt; font-family: "Courier New"; color: navy;">;

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">
style="">      
)

style="font-size: 9pt; font-family: "Courier New"; color: navy;">;

style="font-size: 9pt; font-family: "Courier New"; color: black;">





style="font-size: 9pt; font-family: "Courier New"; color: black;">

 




 




The above is clearly a link worth remembering: I'll certainly be using this method from now on. Many thanks!