cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-774001%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBot%C3%B3n%20de%20recuperaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774001%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPubliqu%C3%A9%20esta%20pregunta%20en%20el%20hilo%20original%2C%20pero%20probablemente%20no%20estaba%20resaltada%20correctamente%2C%20por%20lo%20que%20lo%20intento%20como%20una%20publicaci%C3%B3n%20nueva.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EEl%20c%C3%B3digo%20en%20este%20enlace%20parece%20muy%20%C3%BAtil.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Knowledge-Base%2FHow-to-create-a-Recall-button-on-a-custom-window%2Ftac-p%2F772821%23M368%22%20target%3D%22_blank%22%3EC%C3%B3mo%20crear%20un%20bot%C3%B3n%20Recuperar%20en%20una%20ventana%20personalizada%20-%20Comunidad%20de%20usuarios%20de%20JMP%3C%2FA%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ESin%20embargo%2C%20no%20me%20resulta%20obvio%20c%C3%B3mo%20aprovechar%20correctamente%20la%20funci%C3%B3n%20de%20recuperaci%C3%B3n.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ETengo%20un%20c%C3%B3digo%20(a%20continuaci%C3%B3n)%20que%20tom%C3%A9%20prestado%20y%20modifiqu%C3%A9%20y%20que%20no%20se%20recuerda%20y%20estaba%20tratando%20de%20descubrir%20c%C3%B3mo%20soldarlos.%20Estoy%20cerca%20pero%20me%20falta%20algo%20como%20siempre.%20Se%20agradece%20toda%20la%20ayuda.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20Current%20Data%20Table()%3B%0Acd%20%3D%20Column%20Dialog(%0A%09exy%20%3D%20ColList(%20%22Y%22%2C%20Min%20Col(%201%20)%20)%2C%0A%09exx%20%3D%20ColList(%20%22X%22%2C%20Min%20Col(%201%20)%20)%0A)%3B%0AEval(%20cd%5B1%5D%20)%3B%0AEval(%20cd%5B2%5D%20)%3B%0Ayyy%20%3D%20Expr(%20y()%20)%3B%0Axxx%20%3D%20Expr(%20x()%20)%3B%0Axval%20%3D%20exx%5B1%5D%3B%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20exy%20)%2C%20i%2B%2B%2C%0A%09Insert%20Into(%20yyy%2C%20exy%5Bi%5D%20)%0A)%3B%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20exx%20)%2C%20i%2B%2B%2C%0A%09Insert%20Into(%20xxx%2C%20exx%5Bi%5D%20)%0A)%3B%0Anw%20%3D%20New%20Window(%20%22Annotated%20Multiple%20Plots%22%2C%0A%09For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20exy%20)%2C%20i%2B%2B%2C%0A%09%09Notes%20%3D%20exy%5Bi%5D%20%26lt%3B%26lt%3B%20Get%20Property(%20%22Notes%22%20)%3B%0A%09%09Try(%0A%09%09%09Bivariate(%0A%09%09%09%09Y(%20exy%5Bi%5D%20)%2C%0A%09%09%09%09X(%20exx%5B1%5D%20)%2C%0A%09%09%09%09SendToReport(%0A%09%09%09%09%09Dispatch(%0A%09%09%09%09%09%09%7B%7D%2C%0A%09%09%09%09%09%09%22%22%2C%0A%09%09%09%09%09%09AxisBox(%202%20)%2C%0A%09%09%09%09%09%09Add%20Text%20Annotation(%0A%09%09%09%09%09%09%09Text(%20%22Category%3A%20%22%20%7C%7C%20Notes%20)%2C%0A%09%09%09%09%09%09%09Fixed%20Size(%200%20)%2C%0A%09%09%09%09%09%09%09Text%20Box(%20%7B-80%2C%2025%2C%200%2C%2050%7D%20)%2C%0A%09%09%09%09%09%09%09Filled(%200%20)%0A%09%09%09%09%09%09)%0A%09%09%09%09%09)%0A%09%09%09%09)%0A%09%09%09)%0A%09%09)%3B%0A%09)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%20%3C%2FP%3E%3CP%3EGracias%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAdi%C3%B3s%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3Ellave%20inglesa%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-774001%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomatizaci%C3%B3n%20y%20secuencias%20de%20comandos%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774016%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ERe%3A%20Bot%C3%B3n%20de%20recuperaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774016%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%3CSPAN%3EAdi%C3%B3s%2C%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EA%20continuaci%C3%B3n%20se%20muestra%20una%20combinaci%C3%B3n%20simple%20de%20su%20secuencia%20de%20comandos%20con%20la%20secuencia%20de%20comandos%20a%20la%20que%20se%20hace%20referencia%20en%20%3CFONT%20color%3D%22%230000FF%22%3EC%C3%B3mo%20crear%20un%20bot%C3%B3n%20Recuperar%20en%20una%20ventana%20personalizada.%3C%2FFONT%3E%3C%2FSPAN%3E%20Para%20empezar%2C%20el%20ejemplo%20proporcionado%20utiliza%20un%20cuadro%20de%20di%C3%A1logo%20de%20columna()%20y%20el%20ejemplo%20de%20recuperaci%C3%B3n%20utiliza%20una%20ventana%20nueva%20para%20el%20cuadro%20de%20di%C3%A1logo%20del%20usuario.%20JMP%20hab%C3%ADa%20depreciado%20el%20di%C3%A1logo%20de%20columna%20a%20favor%20de%20la%20ventana%20nueva.%3CSPAN%3E%20%3C%2FSPAN%3E%3CFONT%20style%3D%22font-family%3A%20inherit%3B%22%20color%3D%22%23000000%22%3ELo%20que%20debes%20hacer%20es%20estudiar%20el%20gui%C3%B3n%20y%20aprender%20c%C3%B3mo%20funciona.%20%3CFONT%20color%3D%22%23333333%22%3EIncluye%20varios%20elementos%20que%20requerir%C3%A1n%20cierta%20comprensi%C3%B3n.%20NameSpaces%20es%20uno%20de%20los%20principales.%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0A%0A%2F*%20Assign%20dt%20to%20reference%20a%20table.%20%20Open%20a%20sample%20table%20for%20demonstration%20purposes%20*%2F%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FSemiconductor%20Capability.jmp%22%20)%3B%0A%0A%2F*%20Use%20a%20named%20namespace%20to%20hold%20the%20recall%20values%20*%2F%0AIf(%20!Namespace%20Exists(%20%22Custom%20Dialog%22%20)%2C%20%2F%2F%20define%20namespace%20if%20it%20does%20not%20exist%0A%09dialogRecallNS%20%3D%20New%20Namespace(%0A%09%09%22Custom%20Dialog%22%2C%0A%09%09%7B%0A%09%09%09ycolRecall%20%3D%0A%09%09%09%7B%0A%09%09%09%7D%0A%09%09%09%2C%0A%09%09%09orderRecall%20%3D%0A%09%09%09%7B%0A%09%09%09%7D%0A%09%09%09%2C%0A%09%09%09byRecall%20%3D%0A%09%09%09%7B%0A%09%09%09%7D%0A%09%09%7D%0A%09)%0A%2C%20%2F%2F%20else%20get%20a%20reference%20to%20the%20existing%20namespace%0A%09dialogRecallNS%20%3D%20Namespace(%20%22Custom%20Dialog%22%20)%0A)%3B%0A%0Anc%20%3D%20N%20Col(%20dt%20)%3B%0AlbWidth%20%3D%20130%3B%0A%0A%2F%2F%20The%20program%20to%20execute%20when%20the%20OK%20button%20is%20pressed%0Apgm%20%3D%20Expr(%0A%09nw%20%3D%20New%20Window(%20%22Annotated%20Multiple%20Plots%22%2C%0A%09%09For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20exy%20)%2C%20i%2B%2B%2C%0A%09%09%09Notes%20%3D%20Try(%20exy%5Bi%5D%20%26lt%3B%26lt%3B%20Get%20Property(%20%22Notes%22%20)%20)%3B%0A%09%09%09Try(%0A%09%09%09%09Bivariate(%0A%09%09%09%09%09Y(%20exy%5Bi%5D%20)%2C%0A%09%09%09%09%09X(%20exx%5B1%5D%20)%2C%0A%09%09%09%09%09SendToReport(%0A%09%09%09%09%09%09Dispatch(%20%7B%7D%2C%20%22%22%2C%20AxisBox(%202%20)%2C%0A%09%09%09%09%09%09%09Add%20Text%20Annotation(%0A%09%09%09%09%09%09%09%09Text(%20%22Category%3A%20%22%20%7C%7C%20Notes%20)%2C%0A%09%09%09%09%09%09%09%09Fixed%20Size(%200%20)%2C%0A%09%09%09%09%09%09%09%09Text%20Box(%20%7B-80%2C%2025%2C%200%2C%2050%7D%20)%2C%0A%09%09%09%09%09%09%09%09Filled(%200%20)%0A%09%09%09%09%09%09%09)%0A%09%09%09%09%09%09)%0A%09%09%09%09%09)%0A%09%09%09%09)%0A%09%09%09)%3B%0A%09%09)%0A%09)%0A)%3B%0A%0A%2F*%20Expression%20to%20clear%20all%20current%20settings%20*%2F%20%0AclearRoles%20%3D%20Expr(%0A%09colListY%20%26lt%3B%26lt%3B%20RemoveAll%3B%0A%09colListX%20%26lt%3B%26lt%3B%20RemoveAll%3B%0A)%3B%0A%0A%2F*%20Expression%20to%20store%20the%20current%20settings%20in%20global%20variables%20*%2F%20%0ArecallRoles%20%3D%20Expr(%0A%09dialogRecallNS%3AycolRecall%20%3D%20colListY%20%26lt%3B%26lt%3B%20GetItems%3B%0A%09dialogRecallNS%3AorderRecall%20%3D%20colListX%20%26lt%3B%26lt%3B%20GetItems%3B%0A)%3B%0A%0A%2F*%20Custom%20Launch%20Window%20*%2F%20%0AcustomDlg%20%3D%20New%20Window(%20%22Example%20of%20a%20Custom%20Dialog%22%2C%0A%09Border%20Box(%20Left(%203%20)%2C%20top(%202%20)%2C%0A%09%09V%20List%20Box(%0A%09%09%09Text%20Box(%20%22Example%20dialog%20to%20demonstrate%20a%20Recall%20button%22%20)%2C%0A%09%09%09H%20List%20Box(%0A%09%09%09%09V%20List%20Box(%0A%09%09%09%09%09Panel%20Box(%20%22Select%20Columns%22%2C%0A%09%09%09%09%09%09colListData%20%3D%20Col%20List%20Box(%20All%2C%20width(%20lbWidth%20)%2C%20nLines(%20Min(%20nc%2C%2010%20)%20)%20)%0A%09%09%09%09%09)%0A%09%09%09%09)%2C%0A%09%09%09%09Panel%20Box(%20%22Cast%20Selected%20Columns%20into%20Roles%22%2C%0A%09%09%09%09%09Lineup%20Box(%20N%20Col(%202%20)%2C%20Spacing(%203%20)%2C%0A%09%09%09%09%09%09Button%20Box(%20%22Y%22%2C%20colListY%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%20)%2C%0A%09%09%09%09%09%09colListY%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nmin(%201%20)%2C%20nLines(%205%20)%2C%20numeric%20)%2C%0A%09%09%09%09%09%09Button%20Box(%20%22X%22%2C%20colListX%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%20)%2C%0A%09%09%09%09%09%09colListX%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nLines(%201%20)%2C%20numeric%20)%0A%09%09%09%09%09)%0A%09%09%09%09)%2C%0A%09%09%09%09Panel%20Box(%20%22Action%22%2C%0A%09%09%09%09%09Lineup%20Box(%20N%20Col(%201%20)%2C%0A%09%09%09%09%09%09Button%20Box(%20%22OK%22%2C%0A%09%09%09%09%09%09%09recallRoles%3B%0A%09%09%09%09%09%09%09%0A%09%09%09%09%09%09%09exy%20%3D%20colListY%20%26lt%3B%26lt%3B%20get%20items%3B%0A%09%09%09%09%09%09%09exx%20%3D%20colListX%20%26lt%3B%26lt%3B%20get%20items%3B%0A%09%09%09%09%09%09%09pgm%3B%0A%09%09%09%09%09%09%09customDlg%20%26lt%3B%26lt%3B%20CloseWindow%3B%0A%09%09%09%09%09%09)%2C%0A%09%09%09%09%09%09Button%20Box(%20%22Cancel%22%2C%20customDlg%20%26lt%3B%26lt%3B%20CloseWindow%20)%2C%0A%09%09%09%09%09%09Button%20Box(%20%22Reset%22%2C%20clearRoles%20)%2C%0A%09%09%09%09%09%09Text%20Box(%20%22%20%22%20)%2C%0A%09%09%09%09%09%09Button%20Box(%20%22Remove%22%2C%0A%09%09%09%09%09%09%09colListY%20%26lt%3B%26lt%3B%20RemoveSelected%3B%0A%09%09%09%09%09%09%09colListX%20%26lt%3B%26lt%3B%20RemoveSelected%3B%0A%09%09%09%09%09%09)%2C%0A%09%09%09%09%09%09Button%20Box(%20%22Recall%22%2C%0A%09%09%09%09%09%09%09clearRoles%3B%0A%09%09%09%09%09%09%09%2F*%20Restore%20any%20previous%20settings%20from%20the%20namespace%20variables%20*%2F%0A%09%09%09%09%09%09%09Try(%0A%09%09%09%09%09%09%09%09colListY%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3AycolRecall%20)%3B%0A%09%09%09%09%09%09%09%09colListX%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3AorderRecall%20)%3B%0A%09%09%09%09%09%09%09)%3B%0A%09%09%09%09%09%09)%0A%09%09%09%09%09)%0A%09%09%09%09)%0A%09%09%09)%0A%09%09)%0A%09)%0A)%3B%0AcolListx%20%26lt%3B%26lt%3B%20set%20min%20items(%201%20)%3B%0AcolListy%20%26lt%3B%26lt%3B%20set%20min%20items(%201%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ETenga%20en%20cuenta%20que%20elimin%C3%A9%20varias%20l%C3%ADneas%20de%20c%C3%B3digo%20en%20el%20JSL%20proporcionado%20que%20no%20parec%C3%ADan%20hacer%20nada%20para%20el%20ejemplo.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774024%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Bot%C3%B3n%20de%20recuperaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774024%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPuede%20inspirarse%20en%20el%20script%20que%20proporcion%C3%B3%20Jim%20y%20luego%20aplicarle%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Scripts%2FRecall-Function-Library%2Fm-p%2F49462%23U49462%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-tkb-thread%20lia-fa-icon%20lia-fa-tkb%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3Ela%20biblioteca%20de%20funciones%20de%20recuperaci%C3%B3n%3C%2FA%3E%20.%20Probablemente%20sea%20una%20excelente%20manera%20de%20aprender%20muchas%20cosas%20diferentes%20para%20JSL%20(modificar%20la%20soluci%C3%B3n%20de%20trabajo%20existente%20para%20usar%20un%20paquete%20diferente).%20Personalmente%2C%20no%20me%20gusta%20la%20forma%20en%20que%20funciona%20la%20biblioteca%20de%20recuperaci%C3%B3n%2C%20as%C3%AD%20que%20no%20la%20he%20usado%20(tengo%20la%20m%C3%ADa%20propia%20en%20proceso)%2C%20pero%20hasta%20donde%20yo%20s%C3%A9%2C%20actualmente%20es%20la%20mejor%20manera%20de%20implementar%20la%20recuperaci%C3%B3n%20sin%20escribir%20todo%20usted%20mismo.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774134%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Bot%C3%B3n%20de%20recuperaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774134%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EEsto%20est%C3%A1%20muy%20cerca%20y%20funciona%20como%20se%20describe%2C%20sin%20embargo%2C%20el%20prop%C3%B3sito%20era%20tener%20una%20manera%20de%20forzar%20que%20los%20gr%C3%A1ficos%20tengan%20anotaciones%20basadas%20en%20la%20informaci%C3%B3n%20de%20las%20notas%20y%20de%20alguna%20manera%20eso%20se%20rompe%20en%20esta%20revisi%C3%B3n.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EFaltan%20anotaciones%20y%20las%20notas%20en%20s%C3%AD%20no%20contienen%20nada.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%09%09%09Notes%20%3D%20Try(exy%5Bi%5D%20%26lt%3B%26lt%3B%20Get%20Property(%20%22Notes%22%20))%3B%0A%09%09%09Show(Notes)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%C2%BFAlguna%20pista%20de%20por%20qu%C3%A9%20podr%C3%ADa%20ser%20eso%3F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EGracias%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAdi%C3%B3s%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3Ellave%20inglesa%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774135%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Bot%C3%B3n%20de%20recuperaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774135%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIntenta%20cambiar%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENotes%20%3D%20Try(exy%5Bi%5D%20%26lt%3B%26lt%3B%20Get%20Property(%22Notes%22))%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ea%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENotes%20%3D%20Try(Column(dt%2C%20exy%5Bi%5D)%20%26lt%3B%26lt%3B%20Get%20Property(%22Notes%22))%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eas%20%26lt%3B%26lt%3B%20Obtener%20elementos%20para%20Col%20List%20Box%20devuelve%20una%20lista%20de%20cadenas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774137%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Bot%C3%B3n%20de%20recuperaci%C3%B3n%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774137%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EEso%20es%20acertado%2C%20combinar%20esos%20trabajos.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EGracias%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAdi%C3%B3s%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3Ellave%20inglesa%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
SpannerHead
Level IV

Recall Button

I posted this question on the original thread but it was probably not highlighted properly, so trying as a fresh post.

 

The code at this link looks very useful

 

How to create a Recall button on a custom window - JMP User Community

 

However, it's not obvious to me how to capitalise on the recall function properly.

 

I have some code (below) I borrowed and modified that lacks recall and I was trying to figure out how to weld them together.  I'm close but missing something as usual.  All help appreciated.

 

dt = Current Data Table();
cd = Column Dialog(
	exy = ColList( "Y", Min Col( 1 ) ),
	exx = ColList( "X", Min Col( 1 ) )
);
Eval( cd[1] );
Eval( cd[2] );
yyy = Expr( y() );
xxx = Expr( x() );
xval = exx[1];
For( i = 1, i <= N Items( exy ), i++,
	Insert Into( yyy, exy[i] )
);
For( i = 1, i <= N Items( exx ), i++,
	Insert Into( xxx, exx[i] )
);
nw = New Window( "Annotated Multiple Plots",
	For( i = 1, i <= N Items( exy ), i++,
		Notes = exy[i] << Get Property( "Notes" );
		Try(
			Bivariate(
				Y( exy[i] ),
				X( exx[1] ),
				SendToReport(
					Dispatch(
						{},
						"",
						AxisBox( 2 ),
						Add Text Annotation(
							Text( "Category: " || Notes ),
							Fixed Size( 0 ),
							Text Box( {-80, 25, 0, 50} ),
							Filled( 0 )
						)
					)
				)
			)
		);
	)
);

 

Thanks

 

Slán

 

SpannerHead


Slán



SpannerHead
2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Recall Button

Slán,

 Below is a simple combining of your script with the script referenced in How to create a Recall button on a custom window. To start with, your provided example uses a Column Dialog() and the Recall Example uses a New Window for the user dialog.  JMP had depreciated the Column Dialog in favor of New Window.  What you need to do is to study the script and learn how it works.  It brings in several items that will take some understanding.   NameSpaces being a major one.

Names Default To Here( 1 );

/* Assign dt to reference a table.  Open a sample table for demonstration purposes */
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );

/* Use a named namespace to hold the recall values */
If( !Namespace Exists( "Custom Dialog" ), // define namespace if it does not exist
	dialogRecallNS = New Namespace(
		"Custom Dialog",
		{
			ycolRecall =
			{
			}
			,
			orderRecall =
			{
			}
			,
			byRecall =
			{
			}
		}
	)
, // else get a reference to the existing namespace
	dialogRecallNS = Namespace( "Custom Dialog" )
);

nc = N Col( dt );
lbWidth = 130;

// The program to execute when the OK button is pressed
pgm = Expr(
	nw = New Window( "Annotated Multiple Plots",
		For( i = 1, i <= N Items( exy ), i++,
			Notes = Try( exy[i] << Get Property( "Notes" ) );
			Try(
				Bivariate(
					Y( exy[i] ),
					X( exx[1] ),
					SendToReport(
						Dispatch( {}, "", AxisBox( 2 ),
							Add Text Annotation(
								Text( "Category: " || Notes ),
								Fixed Size( 0 ),
								Text Box( {-80, 25, 0, 50} ),
								Filled( 0 )
							)
						)
					)
				)
			);
		)
	)
);

/* Expression to clear all current settings */ 
clearRoles = Expr(
	colListY << RemoveAll;
	colListX << RemoveAll;
);

/* Expression to store the current settings in global variables */ 
recallRoles = Expr(
	dialogRecallNS:ycolRecall = colListY << GetItems;
	dialogRecallNS:orderRecall = colListX << GetItems;
);

/* Custom Launch Window */ 
customDlg = New Window( "Example of a Custom Dialog",
	Border Box( Left( 3 ), top( 2 ),
		V List Box(
			Text Box( "Example dialog to demonstrate a Recall button" ),
			H List Box(
				V List Box(
					Panel Box( "Select Columns",
						colListData = Col List Box( All, width( lbWidth ), nLines( Min( nc, 10 ) ) )
					)
				),
				Panel Box( "Cast Selected Columns into Roles",
					Lineup Box( N Col( 2 ), Spacing( 3 ),
						Button Box( "Y", colListY << Append( colListData << GetSelected ) ),
						colListY = Col List Box( width( lbWidth ), nmin( 1 ), nLines( 5 ), numeric ),
						Button Box( "X", colListX << Append( colListData << GetSelected ) ),
						colListX = Col List Box( width( lbWidth ), nLines( 1 ), numeric )
					)
				),
				Panel Box( "Action",
					Lineup Box( N Col( 1 ),
						Button Box( "OK",
							recallRoles;
							
							exy = colListY << get items;
							exx = colListX << get items;
							pgm;
							customDlg << CloseWindow;
						),
						Button Box( "Cancel", customDlg << CloseWindow ),
						Button Box( "Reset", clearRoles ),
						Text Box( " " ),
						Button Box( "Remove",
							colListY << RemoveSelected;
							colListX << RemoveSelected;
						),
						Button Box( "Recall",
							clearRoles;
							/* Restore any previous settings from the namespace variables */
							Try(
								colListY << Append( dialogRecallNS:ycolRecall );
								colListX << Append( dialogRecallNS:orderRecall );
							);
						)
					)
				)
			)
		)
	)
);
colListx << set min items( 1 );
colListy << set min items( 1 );

Please note that I removed several line of code in your supplied JSL that did not seem to do anything for the example.

Jim

View solution in original post

jthi
Super User

Re: Recall Button

You can take inspiration from the script Jim provided and then apply Recall Function Library to that. That is most likely pretty great way of learning many different things for JSL (modify existing working solution to use different package). I don't personally like the way that recall library works so I haven't used it (I have my own in the making) but to my knowledge, it is currently the best way to implement recall without writing everything yourself.

-Jarmo

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Recall Button

Slán,

 Below is a simple combining of your script with the script referenced in How to create a Recall button on a custom window. To start with, your provided example uses a Column Dialog() and the Recall Example uses a New Window for the user dialog.  JMP had depreciated the Column Dialog in favor of New Window.  What you need to do is to study the script and learn how it works.  It brings in several items that will take some understanding.   NameSpaces being a major one.

Names Default To Here( 1 );

/* Assign dt to reference a table.  Open a sample table for demonstration purposes */
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );

/* Use a named namespace to hold the recall values */
If( !Namespace Exists( "Custom Dialog" ), // define namespace if it does not exist
	dialogRecallNS = New Namespace(
		"Custom Dialog",
		{
			ycolRecall =
			{
			}
			,
			orderRecall =
			{
			}
			,
			byRecall =
			{
			}
		}
	)
, // else get a reference to the existing namespace
	dialogRecallNS = Namespace( "Custom Dialog" )
);

nc = N Col( dt );
lbWidth = 130;

// The program to execute when the OK button is pressed
pgm = Expr(
	nw = New Window( "Annotated Multiple Plots",
		For( i = 1, i <= N Items( exy ), i++,
			Notes = Try( exy[i] << Get Property( "Notes" ) );
			Try(
				Bivariate(
					Y( exy[i] ),
					X( exx[1] ),
					SendToReport(
						Dispatch( {}, "", AxisBox( 2 ),
							Add Text Annotation(
								Text( "Category: " || Notes ),
								Fixed Size( 0 ),
								Text Box( {-80, 25, 0, 50} ),
								Filled( 0 )
							)
						)
					)
				)
			);
		)
	)
);

/* Expression to clear all current settings */ 
clearRoles = Expr(
	colListY << RemoveAll;
	colListX << RemoveAll;
);

/* Expression to store the current settings in global variables */ 
recallRoles = Expr(
	dialogRecallNS:ycolRecall = colListY << GetItems;
	dialogRecallNS:orderRecall = colListX << GetItems;
);

/* Custom Launch Window */ 
customDlg = New Window( "Example of a Custom Dialog",
	Border Box( Left( 3 ), top( 2 ),
		V List Box(
			Text Box( "Example dialog to demonstrate a Recall button" ),
			H List Box(
				V List Box(
					Panel Box( "Select Columns",
						colListData = Col List Box( All, width( lbWidth ), nLines( Min( nc, 10 ) ) )
					)
				),
				Panel Box( "Cast Selected Columns into Roles",
					Lineup Box( N Col( 2 ), Spacing( 3 ),
						Button Box( "Y", colListY << Append( colListData << GetSelected ) ),
						colListY = Col List Box( width( lbWidth ), nmin( 1 ), nLines( 5 ), numeric ),
						Button Box( "X", colListX << Append( colListData << GetSelected ) ),
						colListX = Col List Box( width( lbWidth ), nLines( 1 ), numeric )
					)
				),
				Panel Box( "Action",
					Lineup Box( N Col( 1 ),
						Button Box( "OK",
							recallRoles;
							
							exy = colListY << get items;
							exx = colListX << get items;
							pgm;
							customDlg << CloseWindow;
						),
						Button Box( "Cancel", customDlg << CloseWindow ),
						Button Box( "Reset", clearRoles ),
						Text Box( " " ),
						Button Box( "Remove",
							colListY << RemoveSelected;
							colListX << RemoveSelected;
						),
						Button Box( "Recall",
							clearRoles;
							/* Restore any previous settings from the namespace variables */
							Try(
								colListY << Append( dialogRecallNS:ycolRecall );
								colListX << Append( dialogRecallNS:orderRecall );
							);
						)
					)
				)
			)
		)
	)
);
colListx << set min items( 1 );
colListy << set min items( 1 );

Please note that I removed several line of code in your supplied JSL that did not seem to do anything for the example.

Jim
SpannerHead
Level IV

Re: Recall Button

This is really close and it works as described, however, the whole purpose was to have a way to force the graphs to have annotation based on the information in the notes and somehow that breaks in this revision.

 

Annotations turn up missing and the Notes themselves don't contain anything.

 

			Notes = Try(exy[i] << Get Property( "Notes" ));
			Show(Notes);

Any clue why that might be?

 

Thanks

 

Slán

 

SpannerHead

 


Slán



SpannerHead
jthi
Super User

Re: Recall Button

Try changing

Notes = Try(exy[i] << Get Property("Notes"));

to

Notes = Try(Column(dt, exy[i]) << Get Property("Notes"));

as << Get items for Col List Box returns list of strings

-Jarmo
jthi
Super User

Re: Recall Button

You can take inspiration from the script Jim provided and then apply Recall Function Library to that. That is most likely pretty great way of learning many different things for JSL (modify existing working solution to use different package). I don't personally like the way that recall library works so I haven't used it (I have my own in the making) but to my knowledge, it is currently the best way to implement recall without writing everything yourself.

-Jarmo
SpannerHead
Level IV

Re: Recall Button

That's spot on, combining those works.

 

Thanks

 

Slán

 

SpannerHead

 


Slán



SpannerHead