3

I would like to create a List Box which can provide me suggestions.The exact thing which i need to implement is the browsers navigation widget where we type in the website address.The functionality to implement is like this

when we click on the down arrow ,my list box should provide me the list of previously navigated URLS. Also when we go ahead and type something,the widget should provide me suggestions.

Any suggestions on how to implement this widget would be really great.

Thanks

Barry
  • 1,585
  • 3
  • 22
  • 35

2 Answers2

3

My SimpleGWT project's ComboBox widget should be very close to what you describe. However, I would warn you that it was written a couple of years back and hasn't been kept up to date with the latest GWT version. Also, it required a few changes to the SuggestBox class to open up the API that I need. With all that in mind, it is Apache 2 licensed Open Source so it should still be useful to you in implementing your own solution even if you can't use it as it is. Feedback is welcome on the project site.

Isaac Truett
  • 8,734
  • 1
  • 29
  • 48
  • Thanks for the code.As you said ,there are some depreciated methods ,but i can try and understand the logic behind the implementation.But i was also thinking of another approach.The approach is to have Absolute Panel with SuggestBox and an PushButton in it.PushButton on click should show the PopUpPanel which the suggestBox uses.But i am unable to figure out how can i access the popUpPanel which was used for the SuggestBox(There is no getter/setter provided in the API) – Barry Dec 21 '10 at 03:36
  • Yep. Getting access to the suggestion menu is part of the "few changes" I mentioned. I tried to get my changes to the API committed, but the timing just wasn't right and I couldn't get a committer's attention long enough. I haven't had the inclination to try again. Another approach you might try is to simply make a copy of SuggestBox in another package and modify it as you need. That way you aren't depending on changes to the core library, but you also won't get any improvements that are made to SuggestBox in future versions. – Isaac Truett Dec 21 '10 at 12:47
  • Well i tried the other approach that you suggested.I copied the SuggestBox API into my own class ,but the API used many private/protected methods from other classes and thus i have problem when i copy paste it to my own package.So i think even this option is ruled out. – Barry Dec 21 '10 at 16:58
  • Did you look into how far the dependencies go? If it's just a few classes, you could copy them as well. You could also try keeping your version of SuggestBox in the original package to gain access to package-protected methods there. – Isaac Truett Dec 21 '10 at 17:50
1

this simple-gwt can help you but you should develop it on your own

Edited: to make it scrollable check this.

Community
  • 1
  • 1
Jama A.
  • 15,680
  • 10
  • 55
  • 88