Search Panel


On most of your screens you will want to include a search panel, although it is an optional feature. JDesignerPro gives you all the Java code necessary to build a search panel with only a few mouse clicks. The Search Panel is made of three elements: (1) the field pull down, (2) the criteria pull down and (3) the constant entry field.

The field pull down list contains those fields you want available for your users to do searches. Specify the searchable columns by highlighting each of the fields you want in the list. You may select all the fields by clicking individually on each.

The second element is the criteria for the search. This includes typical search capabilities such as contains, begins with, equals, etc. The user chooses a field, then a criteria and third, enters a search term in the constant entry field. Each of these elements is built automatically by JDesignerPro when you fill in the properties on this screen. The SQL statements are also generated.

Generally you will want to link a Search Panel with some other Data Component, such as a Result List or grid. The tables chosen for the Search Panel and their unique keys must be identical to those chosen for the other Data Component for the two to work together.

Add Search Panel Settings:

Description in pull down. For each field you select for the search pull down, you can enter a word or several words of your choice to describe that field in the Description in pull down field. To modify the description for a field, double click the field name in the list, then replace the default entry with your own.

After you have typed your entry, simply double click on the next field you wish to change. Do not press Accept until you are finished on this screen. On all JDesignerPro builder screens, you only press Accept after all the properties for a screen have been set, not after each entry.

Constant entry required. This pull down choice determines whether the constant entry field will appear when this field is chosen for a search. There are times when you will not want a search term entered. You might instead build a criteria pull down list that has set values on which the user may search. For example, when the user chooses to search by the field, SalesRegion, the criteria pull down may switch to show only the sales regions in the database and there will be no need to have a constant entry.

Make this the initial choice. This field simply sets the field that has a Yes entry here to be the default search field in the list. It will always appear first when your users load the screen.

Text Value / Actual Value. The properties, Values come from, and Text Value/Actual Value, determine what is in the criteria pull down. Double click on a column name in the list and the Text Value / Actual Value list will populate itself with default criteria values such as Greater than, Less than, Equal to. In the case of a text-type column these values will default to Begins with and Contains.

You may replace the default search criteria with your own. On the left side of the Text Value / Actual Value list is the search term that the user will see and on the right is the SQL equivalent that will be used to query the data. If you enter your own values, be sure that your SQL equivalent is the correct operator.

For example, you might have a column named Status. In the Matching values table you could have Active, Inactive, Pending. The corresponding SQL terms could simply: A, I, P. Where A, I and P are the actual values in the table which determine a user's status.

Values come from. This is a switch to go between a static criteria pull down and one that comes from another table in the Text Value / Actual Value list. If you choose "Fields entered here" you will see the list for static entries. Changing this pull down to "Database table/columns" will reveal three panels. The first panel is a list of the tables available in the chosen database. From this you click once on a table and the column names will populate the right-side panels. The middle panel, Pull down Column, is where you choose the value that the user will see in the criteria list. The Actual Value Column is what value will be entered in the database when the user selects a search column, the search will actually be done with the data in the Actual Value column.

For example, you want your users to search by State, so you build a simple table of two columns. One column contains the long version of the State name and one contains the two character equivalent, which is actually what you store in the database. The syntax is:

=’CA’

The left side of the pull-down definition will show California, while the right side will show the above text. It would look like this:

Etc...

When the user selects California from the search pull down and presses search, the search will be done with "CA". This is a simple example that could be applied to inventory names and matching part numbers, or other such data.

6. Pull down SQL Clause. Use this field to enter your own SQL to filter data before it is returned to the application.

Add Search Panel Action Summary:

Under Definition, highlight the columns in the list that you want in your search panel. Until you select at least one, the Accept button will not work.

If desired, double-click a column name to change the properties on the screen.

The Add Search Panel screen is populated automatically by default values that will work fine for most search needs. You are not required to do anything other than to select the columns in the list and Press Accept. If you don’t want a Search Panel to be on your form, skip this screen and move right to the Add Result List tab. The Add Result List tab may also be skipped by clicking directly on the Column Settings screen, without pressing Accept on the Search Panel and result List screens.

Once you have setup all your searchable columns, press Accept.