Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Value list item when selected performs a find


This topic is 8081 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Saw this done once. Two fields side by side at the top of what looked like a list view. Select the first fiels and a value list appears. select on of the items. So far simple stuff. Now depending on what was selected, what looked to be a find perfomed and only the items that matched showed up. And even better, select a itme from the second fields value list and the find even tightened...using the values from both fields to perform the find.

Now how the heck did they do this? And even more, how did they get fields to be active as pop-ups at the top of a record in what looked to be in list view?

LR

Posted

This is generally done using a portal, which can be made to appear pretty much the same as a list view.

The fields at the top were almost certainly global fields placed outside the portal (though it may have been set up to appear as though they were part of the portal/list).

The global fields in such a set-up provide values which are referenced by a calculation field which is defined as the primary key for the relationship on which the portal is based. The calculation pulls in values from the selections made in the global fields (from the value lists attached to them) and produces one or more corresponding key values which cause corresponding records to appear in the portal.

Whilst this can be made to work with a conventional relationship, it works just as well with a self-join, providing a 'search window' into the current file.

Refinements include a transparent button over the portal row which, when clicked, takes the user instantly to the related record (but on a different layout) - and various forms of "type-ahead" functionality which relate the text entered in the global criteria fields on the basis of 'starts with...' or 'sounds like...' algorithms. However these latter touches involve some fairly heavy 'behind the scenes' calc work.

Posted

Here is another way to fake a pop-up list for doing a search. The pop-up mimics sitting at the top of a list view.

Everything is set up in a list view.

In the body of the page I have a text field that has a pop-up assigned to it. The value list for the pop-up has the alphabet listed from a-z. This field is also hidden, that is to say, it is placed behind another field.

In the header at the top of the list view is a button for "find by alphabet." I have a script assigned to this button that does the following:

Allow user abort [off]

Set error capture [on]

Go to record/request/page/first

go to field ["alphabetic"]

select all

loop

pause/resume script ["0.00.01"]

Exit loop if ["Status(CurrentFieldName)<>"alaphabetic""]

End loop

If ["Status(CurrentError)=400"]

Show Message ["You did not enter any find criteria; all records will be displayed."]

Go to layout [original layout]

Else

Perform Script[sub-scripts, "alphabet"]

End if

What this does is go to the first record in the list view, pops-open the pop-up field that then lists the alphabet from A-Z, and then waits for a user selection. This script insures that the pop-up comes up at the top of the page by going to the first record in the list. If there was any text in the alphabetic field from a previous search it also clears this text out. If no selection is made from the pop-up list or if nothing matches the search, you get a message, and then you are returned to your prevous layout state.

By selecting a letter from the pop-up list a sub script is run. The subscript contains a script that determines which letter of the alphabet was selected.

If ["alphapetic="A" "]

Perform Script[sub-scripts, "A"]

Else

If ["alphapetic="B" "]

Perform Script[sub-scripts, "B"]

Else

and so on.

Then depending on what letter from the pop-up was chosen (lets say it is letter "A") another subscript runs with a find based on a particular field whose first word begins with the letter "A"

A bit of a pain. But it completely works in such a way that when you click on the button at the top (header) of the list view a pop-up window appears at the top of the page in which to choose a criteria from which a find is perfomed.

Not that this will be of too much interest to anyone, just thought I would share the answer I came up with to my own question.

LR

This topic is 8081 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.