how to use JSL to edit a modal dialog windowWhat is the right approach to edit a modal dialog via JSL?
the idea:
- the function add update button adds a button to the data filter
- it works if it is executed AFTER the creation of the window
- in the actual use case, the return value of the window is used as input for the subsequent code.
Therefore, <<TYPE><BR />-> the window will be closed before <FONT face="courier new,courier">add update button() //post</FONT> gets executed </TYPE>
- I tried to add the add update button() via << on open (
... without success
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Add Properties to Table(
{New Script("reread", JSL Quote(caption("reread ...")), As String( 1 ))});
add update button = function ({},
wait();
Current Report()["Local Data Filter",LineUpBox(1)] <<
append(
b = Button Box( "update",
b << close window();
dt << run script( "reread" );
ShowQueryWindow();
)
));
ShowQueryWindow = Function({},
gui = New Window( "test",
//<<TYPE></TYPE>Automation and ScriptingRe: how to use JSL to edit a modal dialog windowOne approach for this in JMP 18 is to use a window handler. The window handler is a function wrapper that allows you to access any window created during the execution of the function. We are looking at making modal and non-modal behaviors more consistent in upcoming major releases, which should make this easier to do directly through the New Window() function in the future.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Add Properties to Table(
{New Script("reread", JSL Quote(caption("reread ...")), As String( 1 ))});
add update button = function ({win},
win["Local Data Filter",LineUpBox(1)] <<
append(
b = Button Box( "update",
b << close window();
dt << run script( "reread" );
ShowQueryWindow();
)
));
showFilter = Function({},
With Window Handler(
New Window( "test",
<<TYPE></TYPE>
Re: how to use JSL to edit a modal dialog windowhi @danschikore, thanks a lot
wonderful 
Re: how to use JSL to edit a modal dialog windowAre you trying to add the update button to the modal window? If you are, I don't think modal window is a report window (it is modal or modal dialog) -> build the modal window in different way
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Script("reread", JSL Quote(caption("reread ...")), As String(1));
add update button = Function({ref},
ref["Local Data Filter", Lineup Box(1)] << append(
b = Button Box("update",
b << close window();
dt << run script("reread");
)
);
);
showFilter = Function({},
collector = V List Box(
dt << data filter(local)
);
add update button(collector);
gui = New Window("test", <<TYPE></TYPE>
I would also suggest trying to add {Default Local} (or defined variable names) to your functions to avoid possible issues but it will require some additional scripting.