YfcShowDetailPopupWithDynamicKey

Description

When called with a specific object (in the HTML object hierarchy this JavaScript function prepares a URL-encoded XML containing all the values under the object (recursively). Only the values to be posted are considered. The XML then is passed on to a pop-up window as a parameter to show the specified view.

Syntax

yfcShowDetailPopupWithDynamicKey(obj, view, entity, inputNodeName, winObj)

Input parameters

obj - Required. Handle to the object based on which the key is dynamically prepared. For the specific object, this function traverses up the HTML hierarchy to find the nearest <table> tag. From that <table> tag, this function then searches for all input and checkboxes. Based on the binding for these controls, a URL encoded XML is formed which is then passed as the entity key to the detail view being invoked.

viewID - Required. Resource ID of the detail view to be shown as a pop-up window. If passed as an empty string, the default detail view of the specified entity is shown in the pop-up window.

entity - Optional. Resource ID of the entity of the detail view to be shown. If not passed, defaults to the current entity.

inputNodeName - Required. Root node name of the XML to be prepared to be passed to the detail view.

winObj - Optional. Anything passed in this field becomes available in the modal dialog through the window.dialogArguments attribute. If this parameter is not passed, an empty object is passed to the pop-up window.

Return value

None.

Example

This example shows how to use this function to invoke list of order lines that can be added to a return. The list of order lines requires an order number to be specified, but this number is editable by the user. Hence, the input cannot be formed on the server side through a makeXMLInput JSP tag. Therefore, the input is prepared on the client side using this function. The following example contains a doClick() function that must be configured to be called when you select a Proceed icon as doClick(this). This way, the button object itself is passed as a parameter to the doClick() function. For this to work, the button object must be in the same <table> tag that contains the order number input box.

function doClick(obj) {
  yfcShowDetailPopupWithDynamicKey(obj, 'YOMD2002', 'return', 
'Order',new Object()); 
}