| 4D v20.1WA Run offscreen area | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v20.1
 WA Run offscreen area 
         | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WA Run offscreen area ( parameters ) -> Function result | ||||||||
| Parameter | Type | Description | ||||||
| parameters | Object |   | Object containing the web area's attributes | |||||
| Function result | Mixed |   | .result property of the onEvent object, or Null if does not return a value | |||||
The WA Run offscreen area command creates a web area in memory which can be used to automatically load and parse web pages.
Note: This command uses the embedded web rendering engine.
In parameters object, pass any of the following optional properties. These properties will be available through the This command within the onEvent method and reference the instance:
| Property | Type | Description | 
| url | text | file object | The URL or file to be loaded in the web area. If omitted or null, a blank page is loaded. | 
| area | text | The name of the web area. If omitted or null, a generic name is assigned (e.g., OffscreenArea1). | 
| onEvent | object (formula) | A callback method that will be launched when the web area is ready. It can be either: 
 | 
| autoQuit | boolean | True (default value) if the command must stop the formula execution when the On End URL Loading or On URL Loading Error events occur. If false, you must use the CANCEL or ACCEPT commands in the callback method or project methods called with the $4d object to close the web area. | 
| timeout | real | Maximum time (expressed in seconds) before the area automatically closes if no event is generated. If set to 0, no limitation is applied. Default value: 60 | 
| result | mixed | Result of the processing to be returned (if any) | 
| <customProperty> | mixed | Any custom attribute to be available in the callback or $4d method. | 
The following property is automatically added by the command if necessary:
| Property | Type | Description | 
| timeoutReached | boolean | Added with true value if timeout has been exceeded | 
If a null value is passed in parameters, a blank web area will be created and then automatically closed.
Notes:
The following commands can be used in the callback method:
You want to create and handle an offscreen web area using a function of your OffscreenArea class:
 $config:=cs.OffscreenArea.new()
 $result:=WA Run offscreen area($config)
 If($config.timeoutReached) //automatically returned in case of timeout
    ALERT("Timeout reached")
 End ifIn the OffscreenArea class:
 Class constructor
 This.url:=File("/RESOURCES/compute.html")
 This.area:="myWAOffscreen"
 
 Function onEvent
 Case of
    :(FORM Event.code=On End URL Loading)
       This.result:=WA Evaluate JavaScript(*;This.area;"myJSMethod();")
 End caseThe OK system variable is set to 0 if the timeout has been reached or the CANCEL was called in onEvent, otherwise it is set to 1.
									FORM Event
									
									Programmed management of Web Areas
									
									WA OPEN WEB INSPECTOR
									
	Product:  4D
	Theme:  Web Area
	Number:  
        1727
        
        
        
	
	Created:  4D v18 R3
	Modified:  4D v18 R6
	
	
	
	
	
	
	
	
	
	
	
	
	4D Language Reference ( 4D v20)
	
	
	4D Language Reference ( 4D v20.1)
	
	
	
 Add a comment
Add a comment