Basic Customization > User Interface Customization > Constructing Wizards > Building Wizards to Edit a Single Object > Sample Code > Main JSP for the Edit Part Wizard
  
Main JSP for the Edit Part Wizard
Filename: <Windchill>/codebase/netmarkets/jsp/part/edit.jsp
Notes:
This can be a single- or multi-step wizard, depending on the product modules installed
Illustrates how to include the Set Classification Attributes and Attachments steps.
This page calls the js function “onloadEditPart” when the page loads. This function calls “loadClassificationStep” to load the classification step if the part is classified and may perform some other UI configurations depending on the wizard launch point.
<%@ 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 uri="http://www.ptc.com/windchill/taglib/attachments"
prefix="attachments" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

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

<%-->
PartHelper.js contains the “onloadEditPartWizard” method
<--%>
<script language="JavaScript"
src="netmarkets/javascript/part/PartHelper.js"></script>

<% if(InstalledProperties.isInstalled(InstalledProperties.SCMI)) {
%>
<attachments:fileSelectionAndUploadApplet
forceApplet='${param.addAttachments != null }'/>
<% } %>



<%-->

The onload javascript method dynamically loads the classification step if the
part is classified. It also disables the check in button when the wizard is
launched from a workspace.

<--%>

<script language="Javascript">

Event.observe(window, 'load', onloadEditPartWizard);

</script>



<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" />

<fmt:message var="attachmentsWizStepLabel"
key="part.createPartWizard.ATTACHMENTS_WIZ_STEP_LABEL" />



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



<% if (request.getParameter("newInWorkspace") == null) { %>

<%--> The part is not new in workspace. Do autoCheckout <--%>

<wip:autoCheckOutItem/>

<% } %>

<% if ((request.getParameter("newInWorkspace") != null) ||
(request.getParameter("checkedOutInWorkspace") != null)) { %>

<script
language="Javascript">newOrCheckedOutInWorkspace=true</script>

<% } %>



<%--Only if SCMI or PartsLink is installed do we use a multi-step wizard<--%>

<% if (InstalledProperties.isInstalled(InstalledProperties.SCMI) ||


InstalledProperties.isInstalled(InstalledProperties.PARTSLINK)) { %>

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

<% } else { %>

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

<% } %>



<jca:wizard buttonList="${buttonSet}"
helpSelectorKey="PartEdit_help">



<%-->

The Set Attributes step uses the common action definition. The JSP file for the
step is, however, part
specific and hooked up using PartManagement-typedservices-properties.xconf

<--%>

<jca:wizardStep action="editAttributesWizStep"
label="${editAttributesWizStepLabel}" type="object"/>



<jca:wizardStep action="setClassificationAttributesWizStep" type="part"/>

<%-->

The attachments step will get enabled or disabled based on the
AttachmentsStepAction
Validator hooked up to it

<--%>

<jca:wizardStep action="attachments_step"
label="${attachmentsWizStepLabel}" type="attachments" />



</jca:wizard>



<%@include file="/netmarkets/jsp/util/end.jspf"%>