OnChange Autocomplete to Null Value

OnChange Autocomplete to Null Value

  
Hi,


I'm using Autocomplete Richwidget to select value in a list of 3000 values. When I select a value that updates several fields using AJAX.

But when I change from a value to empty (Null Identifier), the aplication doesn't interpert that as a change, and all the other fields are unchanged, althought the implemented code predicts the behavior of Null Values, and the correspondent effect.


Thanks for your help,
Renato
It should work. Can you share your eSpace?
Hi, I have the same problem!
When i change to an empty value, the OnChange event is not triggered. Is that a bug?
At the moment is there anything that i can do?

Thanks
Hi João,

The widget was designed to only trigger OnChanges when a value from the list is selected (or when the text exactly matches one of the entries). This is to avoid many server requests with invalid values while writing the values.

Tried some workarounds but couldn't get it to trigger with empty string.
I'd try attaching a jQuery handler to the .Changed event, and using that to click a hidden button that points to the action.

J.Ja
Hi Justin,

Have you tried to do that? I'm not so good with jQuery. If you have a example of how to do, i'll be very glad.

Thanks
Joao -

I haven't tried it that I recall, but here's some sample code for you. It's 100% untested, I'm just typing it into the comment box...

Make an expression, set "Escape Content" to "No", this should be the contents:

"<script type='text/javascript'>
osjs('#" + NAMEOFSELECTWIDGET.Id + "').change(function() {
osjs('#" + NAMEOFHIDDENBUTTON.Id + "').click();
});
</script>"

I highly recommend you learn jQuery. I did some online tutorial thing, it took me about 2 hours of watching videos (I only got through Day 7 of a 30 day course) to learn enough to do what I needed to do. At this point, working on the Web without knowing jQuery is like building houses for a living and not knowing how to use a saw. Sure, if you're really nice, you can convince everyone else to cut boards for you, but it's better to be able to do it yourself. :D

J.Ja
Hi Justin!
Thanks so much for your help. You gaive me some ideas. I'm almost there, but there is something missing.
When the user clicks on the "X" button to clear the input, i couldn't find an event to to be captured and call my javascript function to check if is input cleared of not.

I'm attaching two pictures of how i've implemented that functionality.

Do you how can i capture when the user clicks on the "X" button?

Thanks

I'm attaching the second file here.
My experience has been that using the onclick, onchange, etc. handlers like you are doing often does not work, because the platform is overwriting them with their own handlers. That's one of the reasons I like using the jQuery as an expression on the page, it makes sure that what I write is the handler that gets used.

Instead of writing this as JavaScript, why not just do an Ajax Submit to the page and check the value there?

J.Ja
Hi Joao, 
            I am getting the same error. If I delete the value in the auto-complete field and try to save the record, It sends it to validation as .Identifier is set to -1. Is there any way to change this default behavior ? Is there any way to change the auto-complete widget as changing it for each auto-complete field would not be feasible ? 

Thanks.


João Rosado wrote:
Hi João,

The widget was designed to only trigger OnChanges when a value from the list is selected (or when the text exactly matches one of the entries). This is to avoid many server requests with invalid values while writing the values.

Tried some workarounds but couldn't get it to trigger with empty string.
 
 
Anyone knows if is possible to change the source code of auto-complete to implement that feature? In my opnion this is a must have feature.