cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-774001%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EBouton%20de%20rappel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774001%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EJ'ai%20post%C3%A9%20cette%20question%20sur%20le%20fil%20de%20discussion%20d'origine%20mais%20elle%20n'a%20probablement%20pas%20%C3%A9t%C3%A9%20mise%20en%20%C3%A9vidence%20correctement%2C%20alors%20j'essaye%20comme%20un%20nouveau%20message.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ELe%20code%20sur%20ce%20lien%20semble%20tr%C3%A8s%20utile%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%3EComment%20cr%C3%A9er%20un%20bouton%20de%20rappel%20sur%20une%20fen%C3%AAtre%20personnalis%C3%A9e%20-%20JMP%20User%20Community%3C%2FA%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ECependant%2C%20il%20n%E2%80%99est%20pas%20%C3%A9vident%20pour%20moi%20de%20savoir%20comment%20exploiter%20correctement%20la%20fonction%20de%20rappel.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EJ'ai%20du%20code%20(ci-dessous)%20que%20j'ai%20emprunt%C3%A9%20et%20modifi%C3%A9%20et%20qui%20manque%20de%20rappel%20et%20j'essayais%20de%20comprendre%20comment%20les%20souder%20ensemble.%20Je%20suis%20proche%20mais%20il%20manque%20quelque%20chose%20comme%20d'habitude.%20Toute%20aide%20appr%C3%A9ci%C3%A9e.%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%3EMerci%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAu%20revoir%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ET%C3%AAte%20de%20cl%C3%A9%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%3EAutomatisation%20et%20scripts%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%20%3A%20Bouton%20de%20rappel%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%3EAu%20revoir%2C%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EVous%20trouverez%20ci-dessous%20une%20simple%20combinaison%20de%20votre%20script%20avec%20le%20script%20r%C3%A9f%C3%A9renc%C3%A9%20dans%20%3CFONT%20color%3D%22%230000FF%22%3EComment%20cr%C3%A9er%20un%20bouton%20de%20rappel%20sur%20une%20fen%C3%AAtre%20personnalis%C3%A9e.%3C%2FFONT%3E%3C%2FSPAN%3E%20Pour%20commencer%2C%20l'exemple%20fourni%20utilise%20une%20bo%C3%AEte%20de%20dialogue%20de%20colonne%20()%20et%20l'exemple%20de%20rappel%20utilise%20une%20nouvelle%20fen%C3%AAtre%20pour%20la%20bo%C3%AEte%20de%20dialogue%20utilisateur.%20JMP%20avait%20d%C3%A9pr%C3%A9ci%C3%A9%20la%20bo%C3%AEte%20de%20dialogue%20Colonne%20au%20profit%20de%20la%20Nouvelle%20Fen%C3%AAtre.%3CSPAN%3E%20%3C%2FSPAN%3E%3CFONT%20style%3D%22font-family%3A%20inherit%3B%22%20color%3D%22%23000000%22%3ECe%20que%20vous%20devez%20faire%2C%20c'est%20%C3%A9tudier%20le%20script%20et%20apprendre%20comment%20il%20fonctionne.%20%3CFONT%20color%3D%22%23333333%22%3EIl%20apporte%20plusieurs%20%C3%A9l%C3%A9ments%20qui%20n%C3%A9cessiteront%20une%20certaine%20compr%C3%A9hension.%20Les%20espaces%20de%20noms%20%C3%A9tant%20un%20%C3%A9l%C3%A9ment%20majeur.%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%3EVeuillez%20noter%20que%20j'ai%20supprim%C3%A9%20plusieurs%20lignes%20de%20code%20dans%20votre%20JSL%20fourni%20qui%20ne%20semblaient%20rien%20faire%20pour%20l'exemple.%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%20%3A%20Bouton%20de%20rappel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774024%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EVous%20pouvez%20vous%20inspirer%20du%20script%20fourni%20par%20Jim%2C%20puis%20y%20appliquer%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%20biblioth%C3%A8que%20de%20fonctions%20de%20rappel%3C%2FA%3E%20.%20C'est%20probablement%20un%20excellent%20moyen%20d'apprendre%20beaucoup%20de%20choses%20diff%C3%A9rentes%20pour%20JSL%20(modifier%20la%20solution%20de%20travail%20existante%20pour%20utiliser%20un%20package%20diff%C3%A9rent).%20Personnellement%2C%20je%20n'aime%20pas%20la%20fa%C3%A7on%20dont%20fonctionne%20la%20biblioth%C3%A8que%20de%20rappel%2C%20donc%20je%20ne%20l'ai%20pas%20utilis%C3%A9e%20(j'ai%20la%20mienne%20en%20pr%C3%A9paration)%20mais%20%C3%A0%20ma%20connaissance%2C%20c'est%20actuellement%20le%20meilleur%20moyen%20d'impl%C3%A9menter%20le%20rappel%20sans%20tout%20%C3%A9crire%20vous-m%C3%AAme.%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%20%3A%20Bouton%20de%20rappel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774134%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EC'est%20vraiment%20proche%20et%20cela%20fonctionne%20comme%20d%C3%A9crit%2C%20cependant%2C%20le%20but%20%C3%A9tait%20d'avoir%20un%20moyen%20de%20forcer%20les%20graphiques%20%C3%A0%20avoir%20des%20annotations%20bas%C3%A9es%20sur%20les%20informations%20contenues%20dans%20les%20notes%20et%20d'une%20mani%C3%A8re%20ou%20d'une%20autre%2C%20cela%20interrompt%20cette%20r%C3%A9vision.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ELes%20annotations%20apparaissent%20manquantes%20et%20les%20notes%20elles-m%C3%AAmes%20ne%20contiennent%20rien.%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%3EUne%20id%C3%A9e%20de%20pourquoi%20cela%20pourrait%20%C3%AAtre%20le%20cas%20%3F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EMerci%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAu%20revoir%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ET%C3%AAte%20de%20cl%C3%A9%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%20%3A%20Bouton%20de%20rappel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774135%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EEssayez%20de%20changer%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%3E%C3%A0%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%3Ecomme%20%26lt%3B%26lt%3B%20Obtenir%20les%20%C3%A9l%C3%A9ments%20pour%20Col%20List%20Box%20renvoie%20la%20liste%20des%20cha%C3%AEnes%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%20%3A%20Bouton%20de%20rappel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774137%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EC'est%20parfait%2C%20combiner%20ces%20%C5%93uvres.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EMerci%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EAu%20revoir%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ET%C3%AAte%20de%20cl%C3%A9%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