Mike Jackson
Mike Jackson

Reputation: 427

Does Typeahead work inside a formTable?

I have a custom control that uses a formTable control that has a formColumn control inside it, 3 formRow controls inside the formColumn control and an editBox control in each of the formRow controls. I'm trying to get Typeahead to work on the editBox controls. These are for City, State and Zip Code and Typeahead is using a view called ZIPCodesByCity. Column 1 contains the City, column 2 the State and column 3 the Zip.

Here is my formula for the Suggestions part of the City editBox:

@Unique(@DbColumn(@DbName()),"ZIPCodesByCity",1)

Minimum Characters in the Typeahead is set to 1 and Case-sensitve is unchecked.

When I preview the xpage, Typeahead does not work.

Any ideas?

MJ

Ok, I edited the code to be as follows and it still doesn't work.

@Unique(@DbColumn(@DbName(),"ZIPCodesByCity",1))

Upvotes: 0

Views: 301

Answers (2)

Michael G. Smith
Michael G. Smith

Reputation: 665

Even though I've done it too many times to count, I find that often with DbColumn and Dblookup it's easy to overlook the simple basics:

Have you looked at the ajax response from the typeahead in Firebug to see what is being returned?

Have you tested the DbColumn in a computedField to see what is returned?

Is it possible your DbColumn is exceeding 64k?

Are there any readers fields on the documents in the target view?

Upvotes: 1

Mark Leusink
Mark Leusink

Reputation: 3757

There's a type error in the formula: one of the brackets is positioned wrong. It should be:

@Unique(@DbColumn(@DbName(),"ZIPCodesByCity",1));

In your formula there was an extra ) after the @DbName() call.

Upvotes: 0

Related Questions