Back Forward CDK Home Reference Samples Resources
DBSelect

 DBSelect example

This example illustrates server side population of a "Select" HTML Form tag with a database table.

Simply import the page "DBSelect.html" into Visual JavaScript, and deploy it to a server, making sure everything is set up correctly.

DBSelect Component

This page illustrates the DBSelect JavaScript component. This component is visible both on the server and on the client, and results in an HTML <SELECT> tag. The component must be placed within an HTML <FORM> tag.

Its properties are server side properties, including the DBPool object which defines the database, a table property for specifying the table, and column names for both the display and value lists. If specified, the "Text Expression" property defines an expression (evaluated in the context of the "cursor" object), which can be used to customize the display strings of the pick list.

Like the JavaScript Select List component, this JSObject can be easily connected to other components (with tools like Visual JavaScript VJS), since it publishes its value property as a bound property. In the example below it has been wired to a standard HTML Text field.

To run this example one must manually (or with the help of Visual JavaScript) copy, compile, and add the resulting Web Application to an enterprise server.

 


( return to the top of the page )