Monday, April 16, 2012

Opening a Lookup Window in Search Mode

Lookup windows can display the first page of data, or present search options instead upon activation.

In a sample Northwind application, navigate to Orders page. On the action bar, press New Orders. Click the (select) link in the first data field, Customer Company Name.

Customer Company Name lookup link on New Orders form

The lookup window will show the first page of data rows. The default page size is ten.

Default Customer ID lookup window in Code On Time web application

A user can perform Quick Find or activate the advanced search bar to narrow down the list of available data rows.

Advanced search bar in the lookup window

Let’s activate the search mode immediately when the lookup window is displayed for the first time. This will be useful if the number of lookup records is large. The display of the first page of data has little use in such cases.

Start Code On Time web application generator, click on the project name, and select Design. In the Project Explorer, switch to Controllers tab. Double-click on Orders / Fields / CustomerID node.

Scroll down to the Lookup section. Toggle the checkbox next to Search On Start property.

'Search On Start' property enabled for CustomerID field in Code On Time Designer

Press OK to save the field. On the tool bar, press Browse to generate the application and open it in your default web browser.

Navigate to the Orders page, and create a new order. Activate the Customer Company Name lookup, and you will see the lookup window open in advanced search mode.

Lookup window opened in advanced search mode

Enter the search parameters and press Search to find a record. Alternatively, you can just press the Search button without entering any search parameters, and a full list of customers will appear.

List of records pulled in Customer ID lookup window

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.


© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at http://codeontime.com