Input_AutoComplete OnChange issue

Input_AutoComplete OnChange issue

  
Hi!

I have an  Input_AutoComplete that calls a screen action in the onchange property. That action populates a drop down menu.

All works fine if i use the mouse to select from the autocomplete drop-down but, in IE, if I use the up/down arrows and select using tab, it does not call the onchange action.

Anyone know how i can fix this?

Thx
Hi José,

The OnChange event is really something tricky, browser-wise, if you do a Google search on the subject.

For your specific case, you might want to attach the onKeyPress event as well, and handle it to call the desired action.

Would that do the trick?

See if this topic or this topic solve your problem, and if not, send us a small eSpace that replicates the problem so someone can take a look at it.

Regards,

Paulo Tavares
Sorry for the delay on the reply, but only now I had the oportunity to test this.

I was able to solve the issue not with the onkeypress but with the onblur and passing "osjs(this).trigger('change');"

Thx for the help Paulo
Hi José,

No problem, I'm glad you managed to sort this out - and thanks for sharing the solution as well! I'm sure it'll come in handy for others as well.

Regards,

Paulo Tavares
hi jose

how egsactly did you solve the issue?

i tried setting the following in the extended properties of the input field:
name1: onblur
value1: "osjs(this).trigger('change');"

but the change action still only gets processed,
if i select a value from the autocomplete dropdown

thank you
Hi Manuel,

This topic is quite old and does not have any version mentioned.
There was some improvements on the AutoComplete widget to solve some of these problems (around May, so 1 month after this topic started) on Richwigets 5.1.13+

What version are you using, and if it's a more recent version can you provide a simple example eSpace with it happening?

Regards,
João Rosado
hi joão, thanks for your reply

im runing version 6+ (schould be the most recent one)

i cant directly provide an example
but its basically the autocomplete from the case-submit screen
in the cases espace

i was intending to extend the input field, so it could save the 2 names into 2 separate entity fields
which was when i realised, that something isnt working right

so i tried undoing the 2-3 simple changes, but it still wouldnt work

what "it" is that doesnt work:
i set a breakpoint at the beginning of the autocomplete
and another one at the beginning of the onchange action

when i start typing, the autocomplete breakpoint gets triggered as expected
when i then choose a contact from the autocomplete list, the onchange action gets triggered as expected

BUT if i try changing the contact name again, that doesnt exist yet
(ie realised that youve got the wrong contact, after filling the case information)

the autocomplete gets triggered - so, still as expected
but when i finish typing, no onchange action gets triggered
even if i try tab'ing to the next field, or even pressing enter
Hi Manuel,

Yes, that is actually the "expected" behavior of the inputs onchange with autocomplete.
It is only triggered when there is a match between the text and 1 of the options.


Regards,
João Rosado
but whats with the email and telefone fields when:
you select an existing contact and then want to change it
to a contact that doesnt exist yet?

the email and telefone fields remain locked
and filled with the data from the previous user

as i see it, the autocomplete should be called again
to unlock and empty the rest of the fields

otherwhise you would have to check the contact string
when submiting the new case, to see if it still matches
which in my opinion is a dirty solution