What 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( "Modal Dialog" )
-> the window will be closed before add update button() //post gets executed
- 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( "Modal Dialog" ),
<< on open(add update button()), // doesn't work
dt << data filter( local )
)
);
ShowQueryWindow();
add update button() //post: works