Skip to main content
12-Amethyst
June 20, 2024
Solved

Question about how to hide/show a wizard step based on type selected

  • June 20, 2024
  • 1 reply
  • 945 views

@ShirishMorkhade_238755 Based on your reply on this topic
Three questions,

1) Why checking two types to allowed?  Specifically, why the Parent and then subtype?  Would not the parent override the subtype?  Or do you need to check parent then child?

 

2) In your example above, does "com.ptc.ptcnet.SubTypeTest1", in this example, "* Instantiable"?  Does the parent?

 

3) you mention in comments, wizardStep has to be in type.action, so for security labels on documents, would it be

            var wizardStep = "securityLabels..securityLabelStep";

 

I pulled info from the jsp/documents/create.jspf.

 

Best answer by CraigFinney

Thank you PetrH,

 

Some useful info in actionModels.xml to look into.

 

I was able to resolve what I need by looking at the top level parent which is a subdocument of wt.doc.WTDocument.  Ie..

DocLevel2 (not instantiable) has DocLevel3 and SecondDocLevel3 sub documents, and there is a SecondDocLevel4 (subtype of level3).

I wanted everything below DocLevel2... so I used .. really depends on how you wish to restrict the wizardStep.

if (type_beingCreated.indexOf("DocLevel2") > -1)  {....

to get all the subtype rather than check individually "wt.doc.WTDocument|DocLevel2|DocLevel3" and "wt.doc.WTDocument|DocLevel2|SecondDocLevel3|SecodDoclevel4'" etc.

 

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
June 25, 2024

Hi @CraigFinney 

1. Parent is different type in the code then the subtype so you have to test both if you want to show the option on both types.

2. It does not make difference in the code. Does not matter if it is Instantiable or not. . It is important just from user perspective. If it is not Instantiable, then user can not create the part by wizard.

3. It depends how the actionModels.xml is defined. type + name of action

psb.MyStep 

HelesicPetr_0-1719302642047.png

 

PetrH

CraigFinney12-AmethystAuthorAnswer
12-Amethyst
June 25, 2024

Thank you PetrH,

 

Some useful info in actionModels.xml to look into.

 

I was able to resolve what I need by looking at the top level parent which is a subdocument of wt.doc.WTDocument.  Ie..

DocLevel2 (not instantiable) has DocLevel3 and SecondDocLevel3 sub documents, and there is a SecondDocLevel4 (subtype of level3).

I wanted everything below DocLevel2... so I used .. really depends on how you wish to restrict the wizardStep.

if (type_beingCreated.indexOf("DocLevel2") > -1)  {....

to get all the subtype rather than check individually "wt.doc.WTDocument|DocLevel2|DocLevel3" and "wt.doc.WTDocument|DocLevel2|SecondDocLevel3|SecodDoclevel4'" etc.