Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Rap incubator DropDown/Autosuggest fine tuning(Dynamically provide suggestions / show default suggestions)
Rap incubator DropDown/Autosuggest fine tuning [message #1276385] Mon, 24 March 2014 13:42 Go to next message
Bruno Sinou is currently offline Bruno SinouFriend
Messages: 22
Registered: December 2010
Location: Berlin
Junior Member
Hello,

I'm planning to use the AutoSuggest feature from RAP incubator's projects in an application. I thus have a few questions that seem to be unanswered in the forum.
Rap version is 2.2 and Autosuggest is 0.2

1) If I understand correctly, the suggestion list is statically created at instantiation time. Is there any way to dynamically updates the suggestions depending on the context of the current Text control and/or to define a kind of content provider that can manage the filtering part on the server side (typically using requests on a repository) ?

2) I would also like to display some suggestions on "focus in", when the text is blank. Any hint on this?

Many thanks in advance.

Bruno

[Updated on: Mon, 24 March 2014 13:44]

Report message to a moderator

Re: Rap incubator DropDown/Autosuggest best practices [message #1276983 is a reply to message #1276385] Tue, 25 March 2014 10:03 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

> 1) If I understand correctly, the suggestion list is statically created
> at instantiation time. Is there any way to dynamically updates the
> suggestions depending on the context of the current Text control and/or
> to define a kind of content provider that can manage the filtering part
> on the server side (typically using requests on a repository) ?

There are various options.

- You can exchange the DataSource of the AutoSuggest at any time. Don't
forget to dispose the old DataSource if you don't need it any more.

- You can set a filter script on the DataSource that uses it's own
logic, though at this time you can not exchange the filter or give it
hints at runtime.

- You can use the DropDown widget instead of AutoSuggest, which gives
you the ability to implement the behavior in any way you like on the
server, but won't allow for auto-complete behavior due to the network
latency.

Example:

http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.dropdown.git/tree/examples/org.eclipse.rap.addons.dropdown.demo/src/org/eclipse/rap/addons/dropdown/demo/DropDownDemo.java

We also designed the AutoSuggest so that it would be possible to create
any kind of data source that can for example catch and cache the
suggestions as they are needed, but has not been implemented (yet).

> 2) I would also like to display some suggestions on "focus in", when the
> text is blank. Any hint on this?

The DropDown itself has a setVisible method, but it can not be accessed
from outside the AutoSuggest to prevent the developer from calling
setItems on it (which could cause script errors). However, the
AutoSuggest class is designed to be extendable. If you use it as a super
class, the dropDown widget can be accessed.

Example:

public class MyAutoSuggest extends AutoSuggest {

public MyAutoSuggest( Text text ) {
super( text );
}

public void showSuggestions() {
dropDown.show();
}

}


I hope that helps.

Greetings,
Tim

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Rap incubator DropDown/Autosuggest best practices [message #1514586 is a reply to message #1276983] Wed, 17 December 2014 12:27 Go to previous message
Dirk Polke is currently offline Dirk PolkeFriend
Messages: 4
Registered: May 2013
Junior Member
Hi, I have followed the instructions for 2) as described above. It is working for me, but only if I enter the text field, type an character, which is in the list, then I get the dropdown, when I click again into the field. I had also set a listener on the focus gained event, which makes a autosuggest.open().

Only the first click into the field is not working. Any ideas?

Thanks, Dirk
Previous Topic:Screen will be broken.
Next Topic:RWT Standalone - WEB.XML help
Goto Forum:
  


Current Time: Thu Apr 25 13:22:16 GMT 2024

Powered by FUDForum. Page generated in 0.03402 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top