5,6 → 5,7 |
import java.util.EventListener; |
|
|
import com.google.gwt.i18n.client.Dictionary; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONParser; |
import com.google.gwt.json.client.JSONString; |
17,7 → 18,7 |
import org.tela_botanica.client.AutoCompleteAsyncTextBox; |
|
/** |
* Affiche une liste de nom pour selection. Son retournés le nom selectionné (gettext()) et un code associé (getvalue()). |
* A composite that displays a list of names that can be selected. |
*/ |
|
public class NameAssistant extends Composite implements EventListener, ResponseTextHandler { |
25,23 → 26,16 |
private AutoCompleteAsyncTextBox autoCompletebox = new AutoCompleteAsyncTextBox(this); |
private HorizontalPanel panel = new HorizontalPanel(); |
|
private Mediator mediator = null; |
|
|
public NameAssistant(Mediator med) { |
public NameAssistant(AutoCompleteAsyncTextBoxListener listener) { |
|
mediator=med; |
mediator.registerNameAssistant(this); |
|
|
// autoCompletebox.setFocus(true); |
autoCompletebox.setSearchUrl(mediator.getServiceBaseUrl()+"/NameSearch/"); |
autoCompletebox.setSearchUrl(getServiceBaseUrl()+"/NameSearch/"); |
|
panel.add(autoCompletebox); |
|
autoCompletebox.setWidth("100%"); |
initWidget(panel); |
autoCompletebox.addAutoCompleteAsyncTextBoxListener(mediator.getInventoryItemList()); |
autoCompletebox.addAutoCompleteAsyncTextBoxListener(listener); |
|
} |
|
75,6 → 69,15 |
return autoCompletebox.getValue(); |
} |
|
|
public String getServiceBaseUrl() { |
|
Dictionary theme = Dictionary.getDictionary("Parameters"); |
return theme.get("serviceBaseUrl"); |
|
|
} |
|
|
} |
|