SetWeight method (DataWindows)
Description
Specifies the types of JavaScript code that will be included
in the generated HTML or XHTML.
Controls
DataWindow type |
Method applies to |
---|---|
Web |
Server component |
Syntax
[Web DataWindow server component]
1 |
integer <span>dwcomponent</span>.<span>SetWeight</span> ( boolean <span>allowupdate</span>, boolean <span>validation</span>, boolean <span>events</span>, boolean <span>clientscriptable</span>, boolean <span>clientformatting</span> ) |
Argument |
Description |
---|---|
dwcomponent |
A reference to a Web DataWindow server |
allowupdate |
Specifies whether the generated HTML
When allowupdate is false, validation and clientformatting are |
validation |
Specifies whether the generated HTML
Sets the value of the HTMLGen.ClientValidation property for |
events |
Specifies whether the generated HTML
Sets the value of the HTMLGen.ClientEvents property for the The available events are listed in the “DataWindow event cross-reference”. |
clientscriptable |
Specifies whether the generated HTML
This option adds approximately 100K to the generated HTML. Sets the value of the HTMLGen.ClientScriptable property for |
clientformatting |
Specifies whether the generated HTML
Sets the value of the HTMLGen.ClientFormatting property for |
Return Values
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.
For information about using the Web DataWindow, see the DataWindow Programmers
Guide.
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:
1 |
webDW.<span>SetWeight</span>( 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:
1 |
webDW.<span>SetWeight</span>( true, true, true, false, true ); |
This example specifies that all features are supported:
1 |
webDW.<span>SetWeight</span>( true, true, true, true, true ); |