기본 사용자 정의 > User Interface Customization > Customizing HTML Clients Using the Windchill JSP Framework > Customizing Generic Aspects of JSP Pages > Customizing the UI with Ajax > Solution
  
Solution
Specify some Ajax based configuration and code in the action to allow the Ajax refresh to work.
Solution Elements
Element
Type
Description
<your actions>.xml
XML
XML file that defines menu, toolbar, wizard, and other actions in the Windchill action framework
<your>formProcessor.java
Java
A processor that performs operations based on user data submitted in a wizard
<your wizard step>.jsp
Jsp
Jsp to partially refresh in a wizard
FormResult
Java
A class used to communicate results from a form processor back to the framework.
DynamicRefreshInfo
Java
A class that provides information about the type of partial refresh that should be done.
The information included is:
Oid : the oid that was just created/updated/deleted. (the new oid in the case of update)
locationOid : the oid of the parent location where the object was just created/deleted in a tree, or the oid of the original in the case of update, or just null otherwise
action : add, update or delete. Use the NmCommandBean constants: DYNAMIC_ADD, DYNAMIC_UPD, DYNAMIC_DELETE
DynamicNmContextRefreshInfo
Java
Tree specific specialization of the DynamicRefreshInfo for handling tree paths.
Refresh a row in a table
In the class <your>formProcessor.java, return some dynamic refresh Info in the FormResult:
DynamicRefreshInfo di = new DynamicRefreshInfo (newOid,oid,NmCommandBean.DYNAMIC_UPD) ;
result.addDynamicRefreshInfo(di);
return result;
Note that rows can be added and removed from the table by switching the flag on the refreshInfo to be NmCommandBean.DYNAMIC_ADD or DYNAMIC_DELETE respectively.
Special Tree Refresh Instructions
The second OID or context object passed to the tree refreshInfo is specified to be the parent row. So in the case of adding a row to a tree, it is necessary to specify which parent folder to show the new item under.
Refresh the whole table
Add a component specific onAfterAction event listener for this action to make the appropriate call to refresh a certain part of the window such as PTC.navigation.reload(). One example in the product is the onAfterAction listener on the miniNavigator which refreshes the whole miniNavigator component for many actions: PTC.miniNavigator.onAfterAction.
Making an Ajax Call in Windchill
Procedure - Batching Ajax Requests
Customizing the UI with Ajax