Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TextItem with suggestions

    Hello!
    I hope someone can help me. I want to create a TextItem with suggestions. I have the following situation:
    I have a table with a list of diagnosis. I use GWT-RPC to communicate between client and server (I know this is not very good, but I havenīt programmed this).

    I want that the user can enter any kinds of letters. After each letter input the current value of the TextItem is transfered to the server. The server returns a list with names which should be displayed beneath my TextItem. More or less how it is done at google.com.

    I hope someone can help me, I would be very happy!!!

    Thanks Florian!

    #2
    Try with setValueMap of TextItem with suggestions.
    Br//Marije

    Comment


      #3
      Hello!
      Thank you fpr your response. I have played around on the weekend but I was not successfull. When I use the following code:
      Code:
      final TextItem assumedDiagnosis = new TextItem();
      		assumedDiagnosis.setTitle(lang.assumedDiagnosis());
      		assumedDiagnosis.setRequired(true);  
      		//assumedDiagnosis.setType("comboBox");
      		service.diagnoseAssistenceListDiagnosis(new AsyncCallback<List<ClientDiagnosisRepositoryRecord>>() {
      
      			@Override
      			public void onFailure(Throwable caught) {
      				Window.alert("Error: "+caught);
      				
      			}
      
      			@Override
      			public void onSuccess(List<ClientDiagnosisRepositoryRecord> result) {
      				LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
      				for(int i = 0; i<result.size(); i++){
      					valueMap.put(""+result.get(i).getPID(), result.get(i).getName());
      					assumedDiagnosis.setValueMap(valueMap);
      				}
      				
      			}});
      I get an exception. How can I realize this? Has someone an idea what I have to change in the code?

      Thanks,
      Florian

      Comment


        #4
        What kind of exception you got?
        BR//Marije

        Comment

        Working...
        X