Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tutorial needed to set up entry field locators 1

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
0
0
US
Hi Everyone,

I am using clarion 6.2 with the abc templates.

Can you post a tutorial on the proper way to set up locator fields?

I have a browse listbox with 4 tabs on it created by the browse wizzard. and would like to create an entry locator for each of the tabs. The help file told me to place the entry control after the list but I noticed that the list is outside of the tabs. Do I need to copy the list into each tab?

Thanks in advance.

Emad-ud-deen Richard Leiman
 
Hi Emad-ud-deen / Richard Leiman,

The List Box is OUTSIDE the Tabs is because the TABs serve the purpose of choosing the Sort Order. If you look at the Conditional Behaviour Tab of Browse Properties, you will see the CHOICE(?CurrentTab) = ? options which call different keys to browse the Table. The Tabs are created by the wizard but you can use a Drop List instead of the Tabs. If you are prefer the Tab approach, all you need to do is :
1. Add 4 Local Variables for the Locators.
2. Add the Prompt and Entry Control for the Locators in each of the Tabs.
3. In Browse properties, go to the Locator Behaviour in the Default Behaviour and each of the Conditional Behaviours and override the Locator control and set it to the corresponding Local Variable Entry Control in the Window.

Now the Entry Controls in these different Tabs will act as Locators of the Browse. Please note that Locator works on the First element of the Table key only UNLESS you hand code it otherwise.

Regards
 
Hi.

Thanks for the quick reply.

When I get home I will try it.

Truly,
Emad-ud-deen Richard Leiman
 
Hi ShankarJ,

Thank for helping me get my locators to work. I would never have quessed the individual locator properties were in the Conditional Behavior details screen.

I do need a little more help with one of my locators. It's based on a key with this order: State, City, Street Name, and House Number. Can you tell me how if I can place 3 entry fields on the tab like the other locators but to have the locator locate after the user enters the state, city, and street name? If yes please give details.

Thanks in advance.

Emad-ud-deen Richard Leiman
 
Hi!

Create your local variables for State, City, Street Name, and House Number and put them on the window in the appropriate Tab. Either disable the Entry Locator in Browse properties or set it to the State control. Add a button on the Tab called Locate. Check your browse properties and find out the Browse Class Name i.e BRWn when n is a number. Let's assume BRW1 for the examples. On the Accepted embed - after Parent Call for the Locate Button, enter the following code :

FILE - Table Label, FIL - Table Prefix, FIL:StateKey - Key to use

CLEAR(FIL:Record)
FIL:State = LOC:State
FIL:City = LOC:City
FIL:Street = LOC:Street
FIL:House = LOC:House
SET(FIL:StateKey, FIL:StateKey)
NEXT(FILE)

BRWn.ResetFromBuffer()

Regards
 
Hi ShankarJ,

Thanks for the helpfull post.

Instead of a button I thought about trying your code in the Accepted embed of the entry fields. It worked really nice as soon as the tab key was pressed. After some experimenting, I used this for the state field:

CLEAR(FIL:Record)
FIL:State = LOC:State
SET(FIL:StateKey, FIL:StateKey)
NEXT(FILE)

BRWn.ResetFromBuffer()

And I used the full version for the house number field.

Is it possible make the focus go back to the state field after the focus in in the listbox when the user presses any key while the focus is in the listbox? I noticed that Clarion puts that in if I was using a normal entry locator.

Thanks again for all your help!

Truly,
Emad-ud-deen Richard Leiman
 
Hi!

I suggested a button since there were multiple entry locators. If you want to do a locate on the Accepted embed, just create a Routine to do the ResetFromBuffer based on all the locator fields and call that routine on the accepted embed of all the entry locator controls. Saves code duplication.

Try doing a SELECT(?LOC:State) after the ResetFromBuffer().

Regards
 
ShankarJ,

I will give it a try tonight.

Thanks for the help.

Truly,
Emad-ud-deen Richard Leiman
 
Hi ShankarJ,

The SELECT(?LOC:State) statement worked real well.

Thanks.

Truly,
Emad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top