YfcSetControlAsUnchanged

Description

This JavaScript function eliminates prompting the user to save data when controls are placed on an inner panel. Achieves this by setting controls as "not changed." The something function sets the prompt "Changes made to the data on screen will be lost" from appearing.

After configuring all controls on a page to use this function, call this function for each control on a page before invoking an action.

If an inner panel uses an Action and has modifiable controls that take input required for the Action, you can use this function to prevent the "Changes made to the data on screen will be lost" message.

When using this function, you must also call the yfcDoNotPromptForChanges() function in the JSP containing the Action.

Syntax

yfcSetControlAsUnchanged (control)

Input parameters

control - Required. Object in the HTML object hierarchy.

Return value

None.

Example

This example shows how to call the CallSetControl() function from Action:

<script language="javascript"> yfcDoNotPromptForChanges(true) </script> 
<script language="javascript"> 
function CallSetControl() {
 var myControl=document.all("xml:/InventoryItem/SKU/@OldSKU");
 var myControl_1=document.all("xml:/InventoryItem/SKU/@NewSKU");
 var myControl_2=document.all("xml:/InventoryItem/@EMailID");
 yfcSetControlAsUnchanged(myControl);
 yfcSetControlAsUnchanged(myControl_1);
 yfcSetControlAsUnchanged(myControl_2);
 return(true);
 }
</script>