Edit Acme Part Action
Objective
Configure the Edit Acme Part action on the Actions menu of the Acme part information page.
Solution
1. Create AcmePartEdit.jsp at the location <customizationRootDirectory>\<Acme_WizardModule>\main\src_web\netmarkets\jsp\<custom>\<custompart> and add the following code:
<%@ page import="com.ptc.windchill.enterprise.attachments.server.AttachmentsHelper" %>
<%@ taglib prefix="jca" uri="http://www.ptc.com/windchill/taglib/components"%>
<%@ taglib prefix="wip" uri="http://www.ptc.com/windchill/taglib/workinprogress"%>
<%@ taglib uri="http://www.ptc.com/windchill/taglib/fmt" prefix="fmt"%>
<%@ taglib prefix="wctags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="com.ptc.windchill.enterprise.part.PartConstants" %>

<%@ include file="/netmarkets/jsp/components/beginWizard.jspf"%>
<%@ include file="/netmarkets/jsp/components/includeWizBean.jspf"%>
<wip:autoCheckOutItem />

<fmt:setBundle basename="com.ptc.windchill.enterprise.part.partResource"/>

<%--> Reuse the same labels as for create part <--%>
<fmt:message var="editAttributesWizStepLabel" key="part.createPartWizard.SET_ATTRIBUTES_WIZ_STEP_LABEL" />

<jca:initializeItem operation="${createBean.edit}" objectHandle="custompart"/>


<c:set var="buttonSet" value="EditWizardButtons"/>

<jca:wizard buttonList="${buttonSet}" helpSelectorKey="PartEdit_help">
<jca:wizardStep action="editAttributesWizStep" label="${editAttributesWizStepLabel}" type="object" objectHandle="custompart"/>
<jca:wizardStep action="attachments_step" type="attachments" />
<jca:wizardStep action="moreCustomAttributesWizStep1" objectHandle="custompart" type="custompart"/>
</jca:wizard>

<script lang="Javascript">
PTC.onReady(onloadEditPartWizard);
</script>
<%@include file="/netmarkets/jsp/util/end.jspf"%>
2. Define the action to edit the Acme part in AcmePartclient-actions.xml.
<action name="exampleAcmePartEdit" ajax="row">
<command class="com.ptc.core.components.forms.EditWorkableFormProcessor"
method="execute" url="/ptc1/custom/custompart/exampleAcmePartEdit"
windowType="popup"/>
</action>
* 
This example shows how to configure an existing form processor EditWorkableFormProcessor. You do not need to author any custom logic. However, a custom form processor can be configured and written for any custom logic.
3. Make the Edit Acme Part action available on the information page by adding it incrementally to the existing action model more parts actions in the action model file.
<model name="more parts actions" incremental="">
<action name="exampleAcmePartEdit" type="custompart" insertAt="1" />
</model>
4. Add the following resource bundle entries for the edit action in CustomPartResource.java.
@RBEntry("Edit Acme Part")
public static final String PRIVATE_CONSTANT_100 = "custompart.exampleAcmePartEdit.description";

@RBEntry("Edit Acme Part")
public static final String PRIVATE_CONSTANT_101 = "custompart.exampleAcmePartEdit.title";

@RBEntry("Edit Acme Part")
public static final String PRIVATE_CONSTANT_102 = "custompart.exampleAcmePartEdit.tooltip";

@RBEntry("part_variant_new.png")
public static final String PRIVATE_CONSTANT_103 = "custompart.exampleAcmePartEdit.icon";
5. Restart Windchill to verify if the action Edit Acme Part is available on the Actions menu of the Acme part information page.
6. Click the action to verify that the Edit Acme Part dialog box appears and you are able to edit a part.
Was this helpful?