FloatingTips is not defined

sales2010

Well-Known Member
Hello,

I get this message when i use the autocomplete option for a dbjoin and/or CDD and also when i set the filter to be rendered as autocomplete.

Error: ReferenceError: FloatingTips is not defined
Line: 577

Line 577 is:

Fabrik.tips = new FloatingTips('.fabrikTip', {"tipfx":"Fx.Transitions.linear.easeIn","duration":"500","distance":50,"fadein":false});

The option "Show tips in list view" is set to no for every element and in form i have only validations and no "Tip text" applied.

I use the github version updated yesterday

Thank you
 
there's a second error on the page, which an update from github should solve. - try that first to see if that resolves the initial error as well.
 
Rob and I created a couple of fixes yesterday.

Can you update from GitHub and let us know when you have done this and we will take another look.

Thx. S
 
Hello,

The problem appears again after last update. Also, now i get the message "autocomplete did not find input element". See here .
 
You are still downloading a mixture of minified and non-minified javascript. So when the page contains the following:
JavaScript:
requirejs.config({
 
...
 
    shim: {"fab\/fabrik-min":{"deps":["fab\/mootools-ext-min","fab\/lib\/Event.mock","fab\/tipsBootStrapMock-min","fab\/encoder-min"]},"fab\/window-min":{"deps":["fab\/fabrik-min"]},"fab\/elementlist-min":{"deps":["fab\/fabrik-min","fab\/element-min"]},"fab\/list-min":{"deps":["fab\/fabrik-min","fab\/listfilter-min","fab\/advanced-search-min","fab\/encoder-min"]}},
    waitSeconds: 30,
});
it downloads and runs fabrik-min.js etc., and then when it says:
JavaScript:
requirejs(['fab/fabrik', 'fab/autocomplete-bootstrap', 'fab/encoder', 'fab/lib/Event.mock'], function () {
    new FbAutocomplete(...);
});
it downloads and runs fabrik.js etc.

It looks like my fix may have been overwritten by another change being made in parallel.

Let me look into this. In the mean time, in Fabrik Options (Global Configuration) set Debug JS to so you use non-minified js everywhere.

S
 
Hmm - my fix appears to still be there. Can you reupdate again and see if you still get the error?
 
Hello Sophist,

I have set Debug JS to Yes and i updated the files again. The problem with Floatingtips disappeared but i still see the message "autocomplete did not find input element" in debug and i can't use the autocomplete function for filters (try to search for any value in the filter "Oras").
 
Your autocomplete javascript (in a page with several Fabrik blocks) is different to what I get in my simple form. Yours is of the form:
JavaScript:
new FbAutocomplete('#listform_1_mod_fabrik_list_221 .aplicatii_mesaje___orasvalue',
and
JavaScript:
new FbAutocomplete('#listform_1_com_fabrik_1 .aplicatii_mesaje___orasvalue',
whereas mine is:
JavaScript:
new FbAutocomplete('fch_customer___county',
So yours has a # and a class, mine is just the field name.

Now id "listform_1_mod_fabrik_list_221" exists, but "listform_1_com_fabrik_1" doesn't.

On top of this we have the issue of -min.js if DebugJS is not set.

We need to refer this to Hugh or Rob to look at as it is now beyond my knowledge. Sorry.

S
 
I can't see any of those issues. I set Debug back to just 'allow', and it's loading just the minified JS, if I set it to debug, I just get the uncompressed.

The only error I'm seeing is if I try and autocomplete just the letter 'a', the AJAX call tosses a 500 error, seeming to time out, and the JS then bangs out because the data it's expecting is null. So we need a little defensive codingin the JS to detect null data, and work out why that AJAX call is failing.

How large are the datasets? How many rows would a search for the letter 'a' return?

-- hugh
 
I think that autocomplete needs another option - minimum length for lookup.

So, in this case, assuming an even distribution of second letter, a 2 letter minimum would return c. 400 rows, and a 3 letter minimum would return c. 15 rows.

Of course, the distribution is never even, but I think you can see my point - download of 9500 rows is never going to be quick.

S
 
Yes, a minimum length is a very good idea indeed, i don't know any city in my country to have only one letter :) But if is possible, i would let user decide the minimum length
 
Well - autocomplete could be used for all sorts of things other than cities - US states for example, where a single letter would give only a few results.

If by "user" you mean you and I (i.e. Fabrik developers rather than end-users of the web site) then I agree completely about needing a Fabrik admin setting for the field.
 
I did lobby for a minimum length option before triggering the autocomplete when we originally wrote that code, can't remember why we didn't do it.

What surprises me is, I could have sworn we applied limits to the query, given that I think the JS restricts the menu of choices to 10 (I'd have to check, but I think that's the max). But when I checked the code before my last post, it looks like our autocomplete query is unconstrained.

So yeah ... I can see why an autocomplete query for 'a' would stall if it matches almost 10k rows.

Raising a github issue for Rob on this, so we can at least discuss whether we provide a) a "minimum length before autocomplete fires" option, or b) constrain the autocomplete query to whatever max size the JS shows, or both.

-- hugh
 
If you limit the ajax response, it would need to be whatever it shows plus 1 rows so you know to show the "..." line.

I would vote for the minimum length option myself:

1. Getting the first 10 lines of 10,000 is not much use - unlikely (0.1% probability) of word you want being in the first 10. So this ajax call is somewhat useless.

2. My latest autocomplete has an optimisation for caching which subsets the last query if you type another letter and this wouldn't work if you didn't return all results - so overall autocomplete is more effective (i.e. makes less ajax calls, be quicker for the user) if you have a minimum length instead. (The total response time taken for the entire ajax call to return 200 results is not much longer than for 10, but you save the entire next call if the user adds another character to the string.)

However, minimum length has a few complications. Suppose you have a minimum length of 3 and type "a a":

a. If it is multi-word, this would effectively be "a" and would return loads of values - so you really need to have a minimum word length of 3 not just minimum string length.

b. If it is a "starts-with" autocomplete, and you type "a a" that is a valid combination. I guess this is also true if it is "contains" autocomplete.

Cache optimisations would be helped by knowing if it is a multi-word autocomplete too.
 
Yup, that's why I'm raising an issue on it rather than trying to hack a quick solution together. :)

I still just flat out don't like unconstrained queries, and this is one of the only ones left in Fabrik. In fact, afaik, it's the only one.

Anyway ... let's put a "min chars" option on it, and leave the issue of constraining the query to another day.

-- hugh
 
thank you, hugh. Untill then, how can i solve the problem with the message "autocomplete did not find input element"? I changed the elements in order to load the data much faster, now i use a dbjoin and a cdd element. Unfortunately, the problem still apear even for a cdd element rendered as autocomplete.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top