YfcShowDetailPopupWithParams

Description

This JavaScript function invokes a specified detail view within a modal dialog. You can pass parameters to the detail view by forming a string in the format of name1=value1&name2=value2 and passing this string as a parameter to this function.

This function appends the passed string to the URL that is used to invoke the view. Thus, the passed parameters are available in the request object to the called view.

Syntax

yfcShowDetailPopupWithParams(viewID,name,width,height,params,entity,key, argument)

Input parameters

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

name - Required. Not used. However an empty string must be passed.

width - Required. Horizontal size of the pop-up window. Measured in pixels. If passed as 0, a certain default width is used.

height - Required. Vertical size of the pop-up window. Measured in pixels. If passed as 0, a certain default width is used.

params - Required. String containing parameters to be passed to the detail view being invoked. Use the syntax name1=value1&name2=value2. This appends the string to the URL invoking the detail view which enables the parameters to be available to the detail view of the requested object.

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

key - Optional. Value of the key to be passed as a parameter to the detail view. If not passed, the current view's key is passed to the detail view being invoked.

argument - Optional. Passed as the argument parameter to the showModalDialog() function that is used to show the pop-up window. This then becomes available in the modal dialog through the window.dialogArguments attribute. If this is not passed, an empty object is passed to the modal dialog.

Return value

None.

Example

This example shows how the notes pop-up window is displayed using this function. The notes pop-up window detail view requires certain parameters to be passed to it. For instance, an XML binding pointing to attributes that control if notes are editable for the current order status or not. To accomplish this, the following example forms a string containing these parameters and invokes this JavaScript function.

var 
extraParams="allowedBinding=xml:/Order/AllowedModification&getBinding=xml:
/Order&saveBinding=xml:/Order"; 
yfcShowDetailPopupWithParams('YOMD020', '', "800", "600", extraParams);