Skip to main content
1-Visitor
June 8, 2017
Question

Is it possible to call custom javascript on wizard closing?

  • June 8, 2017
  • 1 reply
  • 4064 views

I would like to know if its possible to call custom javascript when wizard page is getting closed either on the close button or window close? Please help me how to do that?

Thanks in advance.

1 reply

20-Turquoise
June 8, 2017

Austin Nabors-Keating wrote:

I would like to know if its possible to call custom javascript when wizard page is getting closed either on the close button or window close? Please help me how to do that?

Thanks in advance.

Not specifically for close however you can use the afterJS which will call a javascript after a wizard step is complete. From the Windchill help center: "JavaScript function name to invoke on the client side validation for an action window step after the step is completed."

An example of adding this to the ootb defineItemAttributesWizStep action:

   <objecttype name="object" class="wt.fc.Persistable">

      <action name="defineItemAttributesWizStep" afterVK="setAttributesWizStep" id="defineItemAttributesWizStep" preloadWizardPage="false" required="true" resourceBundle="com.ptc.core.ui.componentRB"  afterJS="nameOfMyCustomJavaScriptFunction">

          <component name="defineItemAttributesWizStep" typeBased="true" windowType="wizard_step"/>

      </action>

   </objecttype>

1-Visitor
June 9, 2017

I have used window.onunload achieved the intend. thanks a lot for your response