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
I am very new to Windchill customization and this page.
I am trying to add OOTB revision picker in JSP page for wizard. It can be added in new Part/Document layout page but I want to give this functionality via custom action through Wizard. Is there any way to do it?
If you already have a Wizard running from an action, yes :
The following JSP code will display all the pickers availables, just add it within you wizard jsp page.
<%@ taglib uri="http://www.ptc.com/windchill/taglib/wrappers" prefix="w" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="wctags" tagdir="/WEB-INF/tags" %>
<%-- launching user picker--%>
<wctags:userPicker id="testUserPicker" label="MyUserPicker"/>
<br><br>
<%-- launching organization picker--%>
<wctags:organizationPicker id="orgPicker" label="MyOrgPicker"/>
<br><br>
<%-- launching context picker--%>
<wctags:contextPicker id="contextPicker" label="MyContextPicker" pickerTitle="ContextPicker"/>
<br><br>
<%-- launching Item picker--%>
<wctags:itemPicker id="itemPicker" label="MyItemPicker" pickerTitle="ItemPicker"/>
<br><br>
<%-- launching Item Masterpicker--%>
<wctags:itemMasterPicker id="itemMasterPicker" label="MyItemMasterPicker"/>
<br><br>
<%-- launching Item Masterpicker--%>
<wctags:genericPicker id="genericPicker" objectType="wt.part.WTPart" label="Part Picker using generic"/>
<br><br>
<%-- launching Item Masterpicker--%>
<wctags:genericPicker id="viewPicker" objectType="wt.vc.views.View" label="View Picker using generic"
pickerType="tree"/>
<br><br>
Next you need to retrieve the values in the wizard's processor :
For example, in the following code I retrieve all the inputs values in a unique map :
import com.ptc.core.components.beans.ObjectBean;
import com.ptc.core.components.forms.DefaultObjectFormProcessor;
import com.ptc.core.components.forms.FormResult;
import com.ptc.netmarkets.util.beans.NmCommandBean;
import wt.util.WTException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DummyProcessor extends DefaultObjectFormProcessor {
@Override
public FormResult doOperation(NmCommandBean nmCommandBean, List<ObjectBean> objectBeans) throws WTException {
FormResult result = super.doOperation(nmCommandBean, objectBeans);
Map formParameters = new HashMap();
// Collect all the inputs. text fields, radios, etc...
formParameters.putAll(nmCommandBean.getText());
formParameters.putAll(nmCommandBean.getRadio());
formParameters.putAll(nmCommandBean.getChecked());
formParameters.putAll(nmCommandBean.getComboBox());
// DO something with formParameters
return result;
}
}
Hi Olivier
Thanx for reply.
I know about pickers which you have mentioned in answer, but I am talking about OOTB picker which gets enabled after putting Data Utility Id as revisionPicker for particular attribute.But this comes in Layout.
I want to add Revision Picker on JSP page.
Do you know any way to achieve this?
Thanx,
Pratik
Oh,got it.
It's not easy I guess, as the revision picker must know the revision schema of it's associated object. That's probably why it does not exist as a standalone picker.
In this case I would use a generic picker and handle it's content by myself