[Search and Autocomplete] Ajax refresh on autocomplete selection

Forge Component
Published on 24 Mar (4 weeks ago) by leonardo.fernandes
21 votes
Published on 24 Mar (4 weeks ago) by leonardo.fernandes
Hi, how are you? I'm using the Search & Autocomplete web block and it's working fine, but when I select a record from the list it submits the entire screen. Is that possible to use the Ajax Submit on this record link? I tried to change it on the link of the web block action but it didn't work (nothing seems to happen, or the selected value is not actually selected). Thanks,
Hi Rodrigo. Can you share the eSpace where you're having trouble? Or a URL would do as well.
The component already uses Ajax, so there should be something else going on...

Leonardo Fernandes
Leonardo, this is a huge POC I'm developing for a big company, and there are many sensitive information that I can't share. Is there a way to either schedule a webex so I can show you my screen? A relevant information about this is I'm using SilkUI accordion component, and the autocomplete web block is inside it. 
Hello Rodrigo. In that case, can you reproduce the same problem in a new eSpace? It probably doesn't even need entities or business logic, just an accordeon with the autocomplete. If you are able to reproduce it, please share it with me so I can take a look.

Leonardo Fernandes
Leonardo, I isolate the code. Now you can autosearch for Rodrigo and when you click at the result value, the accordion closes (because the page is submitted withou ajax). What I need is an ajax submit tha do not close the accordion. Is that possible?
Rodrigo, you have a submit link inside the results web block. When you click on that link, of course, a submit request is made.

The correct usage doesn't need any link inside the results, but you must use the Autocomplete\Result web block to wrap your result entries. This is explained in Lesson 02 of the autocomplete component (you can even download the sample at the end of the lesson).

Hope this helps.
Leonardo Fernandes
Hi Leonardo, I'm almost there. I removed the link as you said and added the Result web block. The autocomplete is wortking, but when I select one of the result values it throws an exception (below). Do you know what is this NoSuchMethod? Is there any widget (jar/class) missing?

java.lang.NoSuchMethodError: outsystems.hubedition.webwidgets.uicomponent.AbstractListComponent.getSourceRecordList(Ljavax/faces/context/FacesContext;)Loutsystems/hubedition/runtimeplatform/db/RecordList;
at outsystems.noseventsystem.utils.FindVisitor$ListComponentState.<init>(Unknown Source)
   at outsystems.noseventsystem.utils.FindVisitor$FindComponentVisitor.onEnter(Unknown Source)
   at outsystems.hubedition.webwidgets.uicomponent.utils.ComponentVisitor.visit(Unknown Source)
   at outsystems.hubedition.webwidgets.uicomponent.utils.ComponentVisitor.visitChildren(Unknown Source)

Rodrigo, can you tell me which version of the platform you have on the server side? It appears on the right side of the screen of ServiceCenter. Access http://hostname/ServiceCenter/ and login with the same credentials that you use in Service Studio. On the right of the home screen you will be told the version of the server.

Leonardo Fernandes
Hi Leonardo, here it is:

Enterprise 600
Licensed to XXX (Customer)