This chapter describes possible events that can be used for the communication between the side panel and applications running in the content area.
For reference, you can view a sample application in SAP Business Client, which is available as of SAP NetWeaver 7.0 EHP3. In SAP Business Client, hold the CTRL key and open the Help menu, and choose . Then choose View Source from the context menu.
changedWithXML
Namespace: com.sap.lsapi.dataContext
Parameter evtObject.dataObject: the XML document containing the complete data context
Description : This event is sent to subscribers in all side panel applications and in the content area. The event is triggered with a delay after the data context was changed. A data context can be changed by starting an application or by changing data in SAP GUI and triggering a roundtrip, for example.
loadFromXML
Namespace: com.sap.lsapi.dataContext
Parameter evtObject.dataObject: the XML document that contains new data loaded into the data context. The format of the XML is the same as the format returned by the changedWithXML event.
Description : This event can be triggered by an application. SAP Business Client handles it and parses all namespaces from the XML. Every namespace that is in the XML is completely replaced by the content of the XML. This works only for namespaces where no write access key is specified.
mergeWithXML
Namespace: com.sap.lsapi.dataContext
Parameter evtObject.dataObject: the XML document that contains the new data that is loaded into the data context. The format of the XML is the same as the format returned by the changedWithXML event.
Description : This event is the same as loadFromXML with the difference that namespaces are not replaced, but instead the XML content is merged with the data context. This means that identical keys are overwritten, others are added.
asyncRefresh
Namespace: com.sap.lsapi.dataContext
Parameter: none
Description : This event is triggered after the JavaScript method dataContext.asyncRefresh was called. It is similar to the update event triggered by the icon. No updateFinished event must be sent in this event handler and, therefore, no refresh event is sent to the side panel. The only effect of this event is a changedWithXml event in case of changes in data context.
update
Namespace: com.sap.lsapi.dataContext
Parameter refreshId: Each click on the icon generates a unique ID.
Description : This event is sent to all subscribers in the content area and side panel applications after the icon was chosen. In the event handler, the main application should start updating the data context with the data that is on the screen at the moment. Compare to SAP GUI data extraction. Every subscriber must send an updateFinished message with the same refreshId after finishing the data context update.
updateFinished
Namespace: com.sap.lsapi.dataContext
Parameter refreshId: the same ID received in the corresponding update event
Description : This event must be sent by a subscriber to the update event after finishing the update of the data context. It can be sent asynchronously after a roundtrip. SAP Business Client is subscribed to this event and handles it.
SAP Business Client's updateFinished handler then fires these two events to the side panel for which you have chosen the icon:
changedWithXml event (even if data context is unchanged)
refresh event
refresh
Namespace: com.sap.lsapi.sidePanel
Parameter refreshId: the same ID received in the corresponding update event
Description : This event is sent to the current side panel application after the user has chosen the icon and after at least one subscriber of the update event has sent an updateFinished event. This event can be triggered more than once if there are more subscribers that send updateFinished events.
disconnected
Namespace: com.sap.lsapi.sidePanel
Parameter disconnectedParam.dataObject: true when the user has disconnected the side panel application (by choosing the icon) and false when the user has reconnected the side panel application (by choosing the icon)
Description : This event is triggered after the user has chosen the icon of the current side panel application. This event informs the side panel application that it is connected/disconnected. This means that each side panel application has to implement the logic of disconnected or connected side panel applications itself.
After reconnecting, no further ChangedWithXml event is triggered. Therefore, the application has to wait for the next event to come or should remember the last ChangedWithXml event triggered while disconnected. A disconnected side panel should handle the refresh event to update its view.