Subscribe Bookmark RSS Feed

content table

KinKame

Community Trekker

Joined:

Nov 30, 2015

Has anyone already created a content table in journal with interactive link?

Link
page #1click on link to reach page #1
page #2click on link to reach page #2
......

thank you

2 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

I think you are probably looking for the equivalent of HTML anchor tags (that can take you to a specific place on a web page). To my knowledge there is no near equivalent in the case of a JMP Journal, but it might be possible to contrive something which comes close. The code below is my quick attempt (using Outline Nodes as 'sections' in the Journal):

NamesDefaultToHere(1);

n = 20; // Number of Journal 'sections' (outline nodes)

// (1) Build two lists of display boxes

bbs = {}; // Button boxes (links)

obs = {}; // Outline nodes

For(i=1, i<=n, i++,

InsertInto(bbs, Eval(EvalExpr(ButtonBox("Go To Outline "||Char(i), << UnderlineStyle))));

InsertInto(obs, Eval(NameExpr(OutlineBox("Outline "||Char(i), TextBox("Content "||Char(i)), << close))));

);

// (2) Group these display boxes into two panel boxes

pb1 = PanelBox("Index");

pb2 = PanelBox("Contents");

For(i=1, i<=n, i++,

pb1 << Append(bbs[i]);

pb2 << Append(obs[i]);

);

// (3) Build the JRN

jrn = NewWindow("Contents", << Journal, pb1, SpacerBox(Size(10, 10)), pb2);

// (4) Attach the 'action' script to each button box - NB: Need a script that still works between JMP sessions!

For(i=1, i<=n, i++,

assignScript = Expr(

jrn[ButtonBox(TBD)] << setScript(

cj = CurrentJournal();

For(k=1, k<=kMaxTBD, k++,

cj[OutlineBox(k)] << Close(1);

);

cj[OutlineBox(TBD)] << Close(0);

);

);

SubstituteInto(assignScript, Expr(kMaxTBD), n, Expr(TBD), i);

assignScript;

);


If I've understood what you want correctly, maybe someone will improve on the above. Or maybe there's a completely different approach.

KinKame

Community Trekker

Joined:

Nov 30, 2015

Hmm seems what I'm looking for. thank you very much

Please let me understand your code (thank you for the comments) and put it into my own as my journal has hundreds of pages and I'm not sure expending the outline will direct me to the desired page.

I will feedback on this later on.

best regards

Lionel