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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Hide/Show a wizard step based on type selected

praseeth.moothe
1-Visitor

Hide/Show a wizard step based on type selected

Hi all,


I want to hide/show Step 2 of a wizard based on the type selected in Step 1. Have anyone done anything similar in javascript? Any help is appreciated.


2 REPLIES 2

Hi Praseeth Moothedath

You question is not clear to me as which wizard your taking about - New Part wizard, New Change Request wizard or some other.

I recently work on such requirement where I wanted to hide/show Affected Objects wizard step for one of sub type. And I add below JavaScript to "<WT_HOME>\codebase\netmarkets\jsp\changeRequest\create.jsp" file and it worked for:

<script language="JavaScript">

  PTC.driverAttributes.on("afterRefresh",function() {

      customToggleCreateCADDocStep('affectedDataStep');

    });

  // wizard step should be in format type.action

  function customToggleCreateCADDocStep(wizardStep) {

  var type_beingCreated = document.getElementById("createType").value;

  var allowed_type1 = "wt.change2.WTChangeRequest2";

  var allowed_type2 = "wt.change2.WTChangeRequest2|com.ptc.ptcnet.SubTypeTest1";

  if (type_beingCreated == allowed_type1 || type_beingCreated == allowed_type2) {

       insertStep(wizardStep);

  } else {

       removeStep(wizardStep)

  }

  }

</script>

Thanks,

Shirish

Not quite the same but I modified the create and edit doc jsp to add hidden steps. In the code that is called, it checks the type of the document.

<jca:wizard buttonList="${buttonList}"
helpSelectorKey="DocMgmtDocEdit" title="${title}">
<jca:wizardStep action="editAttributesWizStep" type="object"/>
<jca:wizardStep action="setClassificationAttributesWizStep" type="classification"/>
<jca:wizardStep action="attachments_step" type="attachments" />
<%--- Customizations for Electrical Eng Docs --%>
<%-- process if matches drawings as documents --%>
<jca:wizardStep action="process_drw_docs" type="document" />

<%-- process if matches drawings as documents --%>
<jca:wizardStep action="process_schematic" type="document" />
</jca:wizard>

 

Announcements


Top Tags