I understand that you are trying to control the visibility of containers based on a popup parameter value. I was able to create a dummy mask like your custom mask with two containers (with names ‘Container3’ and ‘Container4’ under the prompt of ‘Specification1’ and ‘Specification2’ respectively) and a popup field (‘No. of models’) which can get populated with values 1 and 2 as shown below:
Containers, unlike mask parameters, need to be accessed by the ‘getDialogControl’ method from the ‘Simulink.dialog.Container’ class. For this, a mask object must be created first, like:
maskobj = Simulink.Mask.get(gcb);
The container properties can then be accessed via:
maskobj.getDialogControl(<container_name>);
The code below demonstrates how to control the visibility of ‘Specification1’ based on the popup parameter value with name ‘Parameter1’ and prompt ‘No. of models’. It hides ‘Specification1’ when ‘No. of models’ is anything other than 1.
selectedVal = get_param(gcb,'Parameter1')
if strcmp(selectedVal,'1')
maskobj.getDialogControl('Container3').Visible = 'on';
maskobj.getDialogControl('Container3').Visible = 'off';
You can also modify the ‘OpenFcn’ callback parameter of the block under Properties > Callbacks > OpenFcn accordingly in a similar fashion to add a callback functionality to the subsystem.
Refer to the following resources for more information:
Hope this helps!