This JavaScript function shows a specific view ID in a pop-up window, which is modal. It is a blocking call; it does not return until the modal dialog box is closed.
yfcShowDetailPopup(viewID, name, width, height, argument, entity, key)
viewID - Required. Resource ID of the detail view to be shown as a pop-up window. If passed as an empty string, the pop-up window displays the default detail view of the entity specified in the entity parameter.
name - Required. Pass as blank space (" "). Not used.
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 height is used.
argument - Required. Anything passed in this field is available in the modal dialog through the window.dialogArguments attribute.
entity - Optional. The entity of the detail view that is to be opened. If not passed, defaults to the same entity of the view that is currently being displayed.
key - Optional. Entity key that is required by the detail view. If not passed, the key of the current entity is passed to pop-up window.
None.
This example shows how the Modification Reason Code pop-up window displays when Save is selected on the Order Detail screen.
function enterActionModificationReason(modReasonViewID, modReasonCodeBinding,
modReasonTextBinding) {
var myObject=new Object();
myObject.currentWindow=window;
myObject.reasonCodeInput=document.all(modReasonCodeBinding);
myObject.reasonTextInput=document.all(modReasonTextBinding);
// If the current screen has a hidden input for draft order flag
// and the value of the input is "Y", don't show the modification
// reason window.
var draftOrderInput=document.all("hiddenDraftOrderFlag");
if (draftOrderInput != null) {
if ("Y" == draftOrderInput.value) {
return (true);
}
}
yfcShowDetailPopup(modReasonViewID, "", "550", "255", myObject);
if (getOKClickedAttribute() == "true") {
window.document.documentElement.setAttribute("OKClicked", "false");
return (true);
}
else {
window.document.documentElement.setAttribute("OKClicked", "false");
return (false);
}
}