Create Acme Part Action
Objective
Configure the Create Acme Part action to display a confirmation message when a part is created.
Solution
Ensure that the Create Acme Part action is available in the Folder Contents toolbar.
1. Click the Create Acme Part action, and verify that the Create Acme Part wizard that opens contains three steps—Set Acme Part Attributes, Set Attachments, More Custom Attributes.
2. Add the required details for the new part and click Finish.
To display a confirmation message after Finish is clicked, perform the given procedure.
1. Create a new action model for buttonList.
<model name="DefaultWizardButtonsNoApply1">
<action name="prevButton" type="object"/>
<action name="nextButton" type="object"/>
<action name="okButton" type="custompart"/>
<action name="cancelButton" type="object"/>
</model>
2. Set the model definition for wizardButtons while defining the wizard as given in the “Author Wizard JSP” section in Create an Acme Part Wizard.
<c:set var="buttonList" value="DefaultWizardButtonsNoApply1" scope="page"/>
<jca:wizard helpSelectorKey="${helpKey}" buttonList="${buttonList}" title="${wizardTitle}"…
3. Specify the JavaScript code snippet to be invoked when creating the Acme part. Here is an example of our own definition for the Finish button shown in the Create Acme Part wizard.
<action name="okButton" id="PJL_wizard_ok">
<command class="" method="" windowType="page" url="javascript:AcmePartSubmitHandler.submitAcmePartWizard();"/>
</action>
4. Define the custom JavaScript code in the file \main\src_web\custom\newwizard\javascript\customWizard.js.
// Handler for processing the Submit confirmation message
var AcmePartSubmitHandler = function(){
var submitDialog;
return {
submitAcmePartWizard: function(){
if( JCAConfirm(event, 'com.acme.custompart.CustomPartResource.CREATE_ACME_PART_CONFIRMATION')){
process = onSubmit(true);
}
return process;
}
};
}();
5. Include the customWizard.js script in the respective JSP page.
<script language='JavaScript' type="text/javascript" src='custom/newwizard/javascript/customWizard.js'>
</script>
6. Restart Windchill to verify that the confirmation message is displayed on creating a new part.
Was this helpful?