Description
Specifies the types of JavaScript code that will be included in the generated HTML or XHTML.
Obsolete method
SetWeight is obsolete and should not be used, because the Web DataWindow technology is obsolete.
Applies to
Syntax
Web DataWindow server component
integer dwcomponent.SetWeight ( boolean allowupdate, boolean validation, boolean events, boolean clientscriptable, boolean clientformatting )
Argument |
Description |
---|---|
dwcomponent |
A reference to a Web DataWindow server component. |
allowupdate |
Specifies whether the generated HTML will be a form with INPUT elements so that the user can change the data. Values are:
When allowupdate is false, validation and clientformatting are ignored and no validation or formatting scripts are generated. |
validation |
Specifies whether the generated HTML will include scripts for validating data the user enters. The scripts implement validation rules defined in the DataWindow object. Values are:
Sets the value of the HTMLGen.ClientValidation property for the DataWindow object associated with the server component. |
events |
Specifies whether the generated HTML will include code for triggering events. Values are:
Sets the value of the HTMLGen.ClientEvents property for the DataWindow object associated with the server component. The available events are listed in the DataWindow event cross-reference. |
clientscriptable |
Specifies whether the generated HTML allows client-side scripts to call methods of the client control. Values are:
This option adds approximately 100K to the generated HTML. Sets the value of the HTMLGen.ClientScriptable property for the DataWindow object associated with the server component. |
clientformatting |
Specifies whether the generated HTML will include scripts for formatting data the user enters. The scripts implement display formats defined in the DataWindow object. Values are:
Sets the value of the HTMLGen.ClientFormatting property for the DataWindow object associated with the server component. |
Return value
Returns an empty string if successful and the syntax error message from the Modify method if it fails.
Usage
When code for more features is included, the Web DataWindow becomes a more robust tool for data entry and manipulation, allowing data validation, formatting, and client-side scripts that react to user actions. However, if your application does not use some of these features, you can decrease the size of the generated code by setting the appropriate options to false.
This method calls the Modify method of the server component's DataStore to set the properties.
These properties can also be set in the DataWindow painter so that the settings are part of the DataWindow object definition.
Examples
This example specifies updating of data is not supported in the server component webDW, but events are supported so client-side scripts can respond to user actions:
webDW.SetWeight( false, false, true, true, false );
This example specifies that all features are supported except client-side scripting. Scripts in the Web page will not be able to call Web DataWindow client methods:
webDW.SetWeight( true, true, true, false, true );
This example specifies that all features are supported:
webDW.SetWeight( true, true, true, true, true );
See also