Number edit box do support << sib but do not support << prev sibIn this script, in the last two functions when the number edit box is changed I'm using that value and its left or right sibling to calculate a new value. When I change the left box I can successfully find its right (next) sibling using << sib. When I change the right box, I cannot get to its previous (left) sibling using << prev sib.
Number edit box do support << sib but do not support << prev sib according to my JMP 14 log. Run attached script and change the number
boxes to test for yourself.
Am I using the right function? If yes, is there a way to work around this omission?
dt = New Table( "untitled 1",
Add Rows( 0 ),
Compress File When Saved( 1 ),
New Table Variable( "First", 1.5 ),
New Table Variable( "Second", 2.4 ),
New Table Variable( "Third", 0 ),
New Column( "Column 1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [] )
)
);
LB = lineup box(NCol(4),
Text box("Factor"),
Text box("Total"),
Text box("Metrology"),
Text box("Process"),
);
TableVariables = dt << Get Table Variable Names();
New window("Variation",
v list box(
LB = lineup box(NCol(4),
Text box("Factor"),
Text box("Total"),
Text box("Metrology"),
Text box("Process"),
),
Button Box( "Write Total",ApplyTotalButton)
)
);
for(i=1,i<=N items(TableVariables),i++,
LB << Append(text Box(TableVariables[i]));
LB << Append(number edit Box(num(dt<<GET table="" variable=""></GET>
Re: Number edit box do support << sib but do not support << prev sibTypically when I want to refer to a grouping of objects, I add a container, for example, create a rowbox, then the syntax
((this << parent) << sib) << sib
would suffice.
However, for your example I would use a table box of a StringColBox, two NumColEditBox, and a NumColBox. If you wanted to refer to the cell, Set Function returns two variables this and which, so it refers to the NumColEditBox and the cell.
However, by naming your boxes you can get by with a single function,
Names Default to Here(1);
dt = New Table( "untitled 1",
Add Rows( 0 ),
Compress File When Saved( 1 ),
New Table Variable( "First", 1.5 ),
New Table Variable( "Second", 2.4 ),
New Table Variable( "Third", 0 ),
New Column( "Column 1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [] )
)
);
TableVariables = dt << Get Table Variable Names();
nvar = nitems(TableVariables);
totval = {};
metval = AsList(J(nvar,1,0));
procval = metval;
For(i=1, i<=nvar, i++,
InsertInto(totval, num(dt<< get Table Variable(TableVAriables[i])))
);
TB = TableBox(
vcol = StringColBox("Factor",TableVariables),
tcol = NumberColEditBox("Total",totval),
mcol = NumberColEditBox("Metrology", metval),
pcol = NumberColBox("Process", procval)
);
vcol << set row borders(0);
pcol << set row borders(0);
New window("Variation",
v list box(
TB,
Button Box( "Write Total",ApplyTotalButton)
)
);
recalcFunction = Function( {this, which},
//When value in this Number Edit Box is changed, get the value from this box and the one to the right and add the result and put it in the text box on the far right.
RMSE = tcol <<GET as="" matrix=""></GET>
Re: Number edit box do support << sib but do not support << prev sibYou can get the parent for the object, and can determine the number of children for the parent, and then move to the child you need to deal with. I have not actually used this methodology, but I have played around a bit with it, and I think you could make it work.Re: Number edit box do support << sib but do not support << prev sibWish list item created, please upvote?
https://community.jmp.com/t5/JMP-Wish-List/Implement-Prev-Sib-for-Displays/idi-p/82669#M394
Re: Number edit box do support << sib but do not support << prev sibAny idea how to (easily) work around this?
I imagine a solution with Xpath could work and then using the locate function using this << get text to figure out which of the number edit boxes is the one that was changed. It would not be robust for repeated values though 
The other option is to create a button that would run through all boxes and do the math, but it is an ugly solution.Re: Number edit box do support << sib but do not support << prev sibPrev Sib is not supported for Displays. It is only available for Tree Nodes. It would be nice if it did work for Displays. I suggest that you enter the request into the JMP Wish List.