Skip to main content
1-Visitor
July 12, 2015
Solved

Add custom step only for subtype of wtpart in createpart.jsp

I have a sub type of wtpart called Regulatory Request.

I have added line item table at step 3 in createpart.jsp.

Line item step is showing for all wtpart subtype. I would like to display the step 3 only for regulatory request.

Thanks,

Sithik

16-Pearl
July 13, 2015

Hi Sithik,

You can follow the below steps

1. Make the wizard step as hidden by default in the custom actions xml file.

e.g.

<action name="test"  preloadWizardPage="false" required="true" hidden="true" >
<component name="test.test" windowType="wizard_step"/>
</action>

2. In the main JSP file using JavaScript function retrieve the type of the object and use below function to display the step at runtime.

  • if (yourtype){
    insertStep(customStepId);

          }

Same mechanism is used on Wtpart details page when you select the checkbox to create a cad document.

Regards,

Bhushan

4 replies

16-Pearl
July 13, 2015

Hi Sithik,

You can follow the below steps

1. Make the wizard step as hidden by default in the custom actions xml file.

e.g.

<action name="test"  preloadWizardPage="false" required="true" hidden="true" >
<component name="test.test" windowType="wizard_step"/>
</action>

2. In the main JSP file using JavaScript function retrieve the type of the object and use below function to display the step at runtime.

  • if (yourtype){
    insertStep(customStepId);

          }

Same mechanism is used on Wtpart details page when you select the checkbox to create a cad document.

Regards,

Bhushan

Translate
ShirishMorkhade
16-Pearl
July 13, 2015

Thanks for pointing this out Bhushan.

I am able to make it work using below steps:

Below is an example of custom JavaScript function:

function customToggleCustomWizardStep(wizardStep) {  
    var ele = element = document.getElementById('!~objectHandle~partHandle~!createType');
    var type = ele.options[ele.selectedIndex].value;
    var desiredPart = "wt.part.WTPart";

    if(type.toLowerCase() === desiredPart.toLowerCase()) {
            // alert(" Inserting Wizard !!! ");
            insertStep(wizardStep);
    } else {
            // alert(" Removing Wizard !!! ");
            removeStep(wizardStep);
    }       
}

And, below is an example of JavaScript function call:

<script language="JavaScript">
    PTC.driverAttributes.on("afterRefresh",function() {
        customToggleCustomWizardStep('CustomActions.customWizardStep');
    });
</script>

Where: CustomActions.customWizardStep is wizard handle.


Thanks,

Shirish

Translate
16-Pearl
July 14, 2015

Shirishkumar Morkhade thanks for putting it together.

PTC.driverAttributes.on("afterRefresh",function()  call is actually necessary as we want to hide the step based on the type selected. This is a good addition.

Sithik Rahamedhulla,

Example code from Shirish should be the exact resolution for your query.


Regards,

Bhushan

Translate
1-Visitor
July 23, 2015

Hi Bhushan,Shirish,

Thank you for your reply. I am able to add custom step based on the type of WTPart.

Thanks,

Sithik

Translate