Pergunta

I am looking for a way to create a popup dialog box when a user double clicks a textinput field that will contain a scroll-able list (from database table) where the user can select a field, hit ok, and have it placed into the textbox when popup closes.

The other major requirement is to have a filter/ or search field in the popup to aid the user in finding the correct option to select from quicker.

What is the best way to implement this?

Modification to gwt's popup panel? maybe a JOptionPane? are there any simple solutions already designed for free commercial use?

Foi útil?

Solução

You could implement this with a com.google.gwt.user.client.ui.PopupPanel. You can make a PopupPanel that contains a ListBox with your data from the database, along with a OK button. When a user selects a value and hits OK, you should utilize an EventBus along with a custom Event that will pass the value to the field on the page. The page will have an event handler that will catch the event and put it into the field.

Another option is to use a com.google.gwt.user.client.ui.SuggestBox. It is a box that autocompletes / suggests values as you type, kind of like the Youtube search bar.

I can offer more resources to help you accomplish this, if you'd like.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top