Adding a Custom Auto-Suggest Search Widget Component
Perform these steps to add a custom auto-suggest search widget component:
1. Add the following entry in the actions.xml file located at <WINDCHILL_HOME>/codebase/config/actions.
<action name="customActionGWT" ajax="component">
<command class="com.ptc.cat.ui.client.action.CustomSearchAndLaunchURLAction" method="execute" url="/ptc1/psb/customURLAction" windowType="popup"/>
</action>
* 
The CustomSearchAndLaunchURLAction is the default implementation class. You can define your own class that implements the SearchWidgetAction interface.
2. Add the following entry in the actionmodels.xml file located at <WINDCHILL_HOME>/codebase/config/actions.
<action name="customActionGWT" type="psb">
<ribbonInfo buttonType="searchwidget" orientation="vertical"/>
</action>
* 
It is not required to provide the value for buttonscale since it is redundant, as the buttonscale value is always SMALL.
3. Set the following properties as per your configuration.
gwt.buttontype.searchwidget.ActionNames -Action Names defined in actions.xml, which have buttontype set as searchwidget. This can be multivalued.
gwt.buttontype.searchwidget.<yourActionName>.SearchOnAttribute -The attribute on which you want to perform search.
gwt.buttontype.searchwidget.<yourActionName>.SearchOnAttributeType -The type on which the above attribute is defined.
gwt.buttontype.searchwidget.<yourActionName>.SearchOnTypes -The Types you want to search. This can be multivalued.
gwt.buttontype.searchwidget.<yourActionName>.AttributesToLoad -Any additional attributes to be displayed in search result. By default, identity is displayed.
This can be multivalued but currently only 2 values are supported.
See the following example.
4. Restart method server.
xconfmanager -s "gwt.buttontype.searchwidget.ActionNames=customActionGWT" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.SearchOnAttribute=name" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.SearchAttributeOnType=wt.epm.EPMDocument" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.SearchOnTypes=wt.epm.EPMDocument,wt.doc.WTDocument" -t codebase/wt.properties -p
xconfmanager -s "gwt.buttontype.searchwidget.customActionGWT.AttributesToLoad=state" -t codebase/wt.properties -p
Was this helpful?