Monday, March 25, 2013

Re: How to use Objects in SuggestBox instead of text Strings?

Hi,

A very simple solution is to create an method by name public String getDisplayString() in your class Foo, which should return either bar or any other String field whichever you wanted to display on your SuggestBox.

On Monday, 18 March 2013 15:50:05 UTC+5:30, membersound wrote:
Hi,

I want to extend my MultiValueSuggestBox to not display strings, but a specific String property of an Object (or DTO).

My goal is: a user should create an objects with several properties, and only show one of these properties for suggetions.
But when the user later renames this specific property that is used in the suggestions, I also want to apply the renaming there.

So I somehow have to save the ID of the object in the suggestBox, but let it show another property from the object belonging to that id.

class Foo {
   String bar; //to be displayed in suggest box, and renamable by the user
   int number;
   long id; //reference tracking for suggestbox
}

Could you get me started what I'd have to change in MultiValueSuggestBox for using Objects

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment