cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Translate the entire conversation x

Dependent Listbox doesn't retain value on save and then open

sjupp
10-Marble

Dependent Listbox doesn't retain value on save and then open

I have two list boxes (MathCAD Prime 11.0.0.0), The selection of one list box drives the list of the other box (see picture). The problem I have is the values update on re-opening the sheet. I can get the sheet to remember the 'Type' selection. However I can't get the second list box to remember the selection from the previous save and close. Below is the code in the jscript:-

 
// TODO: Add your initialization code here
ListBox.ResetContent();
// Add Strings here as needed
 
function ListBoxEvent_Start(Inputs, Outputs) {
   // TODO: Add your code here
ListBox.ResetContent()
if(Inputs[0].Value=="UC"){
ListBox.AddString("356 x 406x 1299");
ListBox.AddString("356 x 406x 1202");
ListBox.AddString("356 x 406x 1086");
ListBox.AddString("356 x 406x 990");
... (the full script code is attached)
So I know/suspect the issue is the 'ListBox.ResetContent()' line but how do I stop the script running on open or remembering the selection, so that it keeps the previous save options?
The sheet options are shown in the screen grab 'sheet options selections.png', I have seen that if items in this list to do with scripts could be a solution, but the check options don't look they would help as they are to run scripts.
Any ideas?
7 REPLIES 7

With your Mathcad options of not running the Advanced Control script on worksheet open or recalculate, you can have, say, HEB selected on the first List Box and HEB320 retained on the second listbox upon saving, closing, and reopening the worksheet if you... upgrade to PTC Mathcad Prime 11.0.1.0.

 

This is one of the things that was fixed from 11.0.0.0 to 11.0.1.0. https://www.ptc.com/en/support/article/CS449753 

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
Werner_E
25-Diamond I
(To:DJNewman)


Mathcad Prime 11.0.1.0.

 


Oops, I wasn't even aware that this intermediate version existed. Thanks for the information.

Is there a full list of all the changes, improvements and bug fixes somewhere? Not spread across different KB articles.

Yeah, marketing (me) hasn't done a great job announcing this exists. It was the feature story in September's Mathcad Minute, and that's about it!

I actually remember that the original poster, Mr. Jupp, had asked our product manager last year about an in-product notification or prompt that there is a new version available and to make downloading it easier, because at the time he hadn't heard of 10.0.1.0's existence. And now... no one knows about 11.0.1.0's.
(Obviously no work went into such a prompt.)

 

 

You're familiar from Prime 10.0.1.0 about the PTC Update Advisor:

DJNewman_0-1761078356711.png

 

Unfortunately, the Update Advisor remains an incomplete list. It only reports resolved issues that have an SPR number. There were other things fixed as well but aren't documented here or anywhere else. In fact, even I don't know what they are... Sure makes it hard to market it, huh...

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
Werner_E
25-Diamond I
(To:DJNewman)

Thank you for the information, but I find the Update Advisor quite useless as its overly cumbersome, confusing and incomplete. It's a real shame that PTC can't provide proper clear documentation of the product history, showing all the changes and improvements to each version at a glance. This does not really create a professional impression.

 

According announcing new versions an in-product announcement sure is one option (provided it is not too intrusive). However, it would be better to have an automatic update option directly within the programme for minor updates such as these interim versions. This would save users from having to log in to the PTC website, search for the software, download it and then start and install it. Once such a mechanism is in place, bug fixes and similar updates should be installed on an ongoing basis. Surely PTC can update a program without having to reinstall the entire software package each time?

As for the major versions it has proven to make sense to have older versions installed in parallel - especially for helping here in the forum as Prime is not able to save a worksheets in the format of an older version.  Being able to save in older formats sure would be a valuable feature - after all the few improvement from one version over the version of one year ago sure don't justify a new incompatible file format every year.

sjupp
10-Marble
(To:DJNewman)

So the upgrade solved the issue with the advanced listbox's updating so that works ok. but now it requires the sheet ORIGIN to be set to '0'. we can obviously do this but have historically using the ORIGIN=1. I Tried updating this line "if(Inputs[0].Value=="UC"){" to be "if(Inputs[1].Value=="UC"){" with the view that I could keep the ORIGIN=1, but it doesn't work, I feel like I am missing something here? Or I suspect there is an issue here with the use of Jscript and compatibility with the calculation origin.

This is a known problem with JScript where the worksheet ORIGIN has to be 0.

 

(I don't know why this information is not in Mathcad Help.)

 

I've asked around and I've been advised to advise you to create a ticket with technical support. Tech support may or may not have developed a workaround with this, but neither I nor the person I'm asking actually know if that workaround exists.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.

I just got a new update on this from the Mathcad team...

 

JScript and Python controls with ORIGIN = 1
•  This is a bug that surfaced in Prime 11.0.1.0
•  Workaround: Hard define ORIGIN to zero in the worksheet (ORIGIN:=0) before the first control then set it back to one after the control. If multiple controls in worksheet, then set it to zero before each control and reset to one after. 
•  Will be fixed in Prime 12

 

I wish that our bug-fixing build didn't create a new bug (average software company experience), but what do you think about the workaround?

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
Announcements

Top Tags