Content

Overview

Calling Lookup Pages from the maint Element

Example 1

Example 2

 

Calling Lookup Pages from the sdclinkmaint Element

Example 1

Example 2

Example 3

 

Overview

Top ../images/arwup.gif (846 bytes)

The maint Element and sdclinkmaint Element contain the "Lookup Columns" property collection, which allows these Elements to determine the content and behavior of Lookup pages called by the Element.

To allow the calling page to customize a Lookup page, a standard MaintenanceList Page Type is used as the Lookup page. This allows customization of columns, buttons, queries, and restrictive where clauses through the request.  A JSON Property List is sent as a string through the POST data from a form (security issues prevent it from being sent through the URL).  This Property List is then merged with the MaintenanceList pages properties.

MaintenanceList pages label each row with a primary row id, and include information about all values in a row (rather than just the return values).  Thus, all columns can be returned from a MaintenanceList page, and specific values can be selected from any row and column.

For backward-compatibility with pre-DM0502 LabVantage versions, the old lookup.jsp has been retained.

 

Calling Lookup Pages from the maint Element

Top ../images/arwup.gif (846 bytes)

The Lookup Columns property collection in the maint Element contains properties for overriding/adding columns to an existing Lookup page, or customizing the Lookup page's behavior to return only the required columns to the desired field on the calling page.

If no Lookup page is specified (Lookup URL property), a standard MaintenanceList page is built from the request.

This mechanism is backward-compatible with the previous LabVantage version.  If none of these features are used, Lookup pages should work as they in the previous version.

Example 1

 

This example customizes a Lookup page that is launched from the "Sample Point" field of the OOB SampleMaint page (MaintenanceForm Page Type).

The "Sample Point" Lookup page has Sample, Description, and Product columns:

You can change the columns displayed, their sequence, and which are visible and hidden.

To do this:

1. Edit the maint Element in the SampleMaint page.
2. For the Sample Point column, access the Columns Lookup URL Lookup Columns property collection, then add a column.
3. Provide a "Column Id" (such as the "notes" column).
4. Set the "Mode" property to "Display Only" (this displays the value, but it does not return it).
5. Save these changes.

NOTE:   If you do not specify a page in the Columns → Lookup URL → HRef property, a standard MaintenanceList page is used as the Lookup page.  In this case, you can still use the Columns → Lookup URL → Lookup Columns property collection to define its columns.

Go back to the SampleMaint page, refresh it, then try the "Sample Point" lookup again.  The Lookup page now displays the additional "Notes" column you have added.

You can also return the value of the "notes" column for the "Sample Point" you chose in the Lookup, and put that value into a different field on the SampleMaint page (such as the "Submitter" column).

To do this:

1. Edit the maint Element in the SampleMaint page.
2. For the Sample Point column, access the Columns - Lookup URL - Lookup Columns property collection.
3. Set the "Mode" property to "Display and Return".
4. Choose a field on the SampleMaint page into which the "notes"� value will be placed.
5. For the "Map to Column" property, specify the columnid of this field (such as "submitterid").
6. Save these changes.

Go back to the SampleMaint page, refresh it, then try the "Sample Point" lookup again.  In the Lookup page, choose a Sample Pont.  The Sample Point is filled into the "Sample Point" field, and the value of the "notes" column is placed into the "Submitter" field.

Example 2

 

This example uses Advanced Properties to lookup a value for a field on the SampleMaint page, then place it into a different field.  Along the way, properties related to this feature are also discussed.

In the maint Element, if you do not specify a page in the Columns - Lookup URL - HRef property (or you do, but you want to override the SDC), use the SDCId (advanced) property.  You can also choose (or override) the SelectorType, append a Restricted Where to bring back precisely what you require.

For the Dialog Type, the default remains BrowserDialog for backward-compatibility.  However, we encourage the use of LabVantage dialog instead (for reasons of performance and flexibility).

For the Project column, access the Columns - Lookup URL - Lookup Columns property collection:

1. Add the notes column as in the previous example.
2. For Mode, choose Display Only.
3. For Display Value, enter =No Notes to display "No Notes" if there are not any.
4. Save these changes.

Go back to the SampleMaint page and refresh it.  Lookup the Project, and the LabVantage Dialog appears.

Querying (such as OK on blank search field as shown above) shows that it now has checkboxes, a Select button, and will show "No Notes" if the notes column is null.

If you select a few checkboxes, the Lookup page puts this into a semicolon-delimited list and passes it to the Project field of the SampleMaint page.

Remember that if you do not use any of these properties, the Lookup mechanisms revert to pre-DM0502 behavior to ensure backward-compatibility.

 

Calling Lookup Pages from the sdclinkmaint Element

Top ../images/arwup.gif (846 bytes)

The Lookup Page Columns property collection in the sdclinkmaint Element contains properties for overriding/adding columns to an existing Lookup page, or customizing the Lookup page's behavior to return only the required columns to the desired field on the calling page.

If no Lookup page is specified (Lookup URL property), a standard MaintenanceList page is built from the request.

Also, the sdclinkmaint Element has the New Item Details property collection, which allows operations such as merging with a specified Lookup page (as shown in the examples below).

These mechanisms are backward-compatible with the previous LabVantage version.  If none of these features are used, Lookup pages should work as they in the previous version.

Example 1

 

This example customizes a Lookup page that is launched from the "Add" button of the sdclinkmaint detail Element on the OOB ParamListMaint page.  We will select a Lookup page, then merge a column into it.

Clicking "Add" opens the Lookup page in a LabVantage dialog.

Edit the sdclinkmaint Element in the ParamListMaint page.

In the New Item Details property collection:

For the Lookup Page property, choose a Lookup page.

In the Lookup Page Columns property collection:

Add a column (such as the "notes" column).

For the Display value, choose "Display Only"�.  Note that we have added Hidden Only (don't want to return it, just make it a hidden column if you want to do something like just use it to run a client-side script).

The "Map to Column" and "Dialog Type" functionality are the same as that previously described for the maint Element.

In the New Item Details property collection:

Set the "Merge with Lookup Page" property to "Yes". If you do not do this, the "notes" column will not be displayed in the Lookup page you have selected.  Setting this property to "Yes" merges the Lookup Page Columns property collection definitions into the page.

Save the changes.

You should see the "notes" column merged into the Lookup page.

Example 2

 

This example overrides column values in a Lookup page.

When we clicked Add in the previous example, we launched a Lookup with a ParamId and Description, then we added the notes column.  But if we go back to the sdclinkmaint Element, in the ParamId column, change the title to "A Param" to override the Lookup page's Parameter title ...

... and Return (not Display) the Description ...

... the Description column is hidden, and the ParamId title is "A Param"�.

Always make sure you return the ParamId (Mode = Display and Return) first, otherwise it will return the Description instead.

Selecting some values returns them to the detail:

Example 3

 

This example demonstrates Add and Edit lookup functionality.

Clicking Add in the sdclinkmaint detail opens a Lookup page with Add and Edit buttons.

When you select items and click Add in the dialog . . .

. . . the Add page loads to add a Parameter:

Clicking Return to Lookup (actually the standard Return to List button relabeled) reloads the Lookup page with you selections still intact.

Clicking the Edit button opens an Edit page:

And Return to Lookup bring you back as before.

An additional benefit is that if you add a new item (click Add in the dialog):

The new Param is added to the dialog as a selection:

This functionality is defined under the sdclinkmaint Standard Button properties as the Store Selection property (set to Y).  This property is applicable only to List pages, and Add and Edit buttons.