Is it possible to split the offers from a GWT offer into separate groups / categories?

I have a proposal that contains 2 types of proposals. Let's assume offer A

type and offer type B

.

I would like to split the displayed offers into 2 subscriptions in offers so that all type offers A

are grouped together and all type offers are B

grouped separately.

I haven't seen anything in SuggestBox

or SuggestOracle

that would allow me to do this? It seems like this is something that should be supported.

Any help would be great. Thank!

+3


source to share


3 answers


SuggestBox

The default display of suggestions is MenuBar

in PopupPanel

, but you can provide your own screen to be split A

and B

separate and display them in two lists, or you still want to display them.



+3


source


Here's my quick suggestion, it's untested, but maybe it will help you on the right track:

  • Create your own SuggestOracle

    , best to expandMultiWordSuggestOracle

  • Make sure to override isDisplayStringHTML

    to return true (but note the usual threats when entering values ​​like HTML - XSS, etc.).
  • Add a new method add

    that will accept the previous sentence, change it to include some HTML / CSS code that will make the end of the previous group of sentences.


Some pseudocode:

MyOracle oracle = new MyOracle();
oracle.add(suggestion1); // Group A
oracle.add(suggestion2);
oracle.newSuggestionGroup(); // insert, for example, <hr /> to the previous suggestion string, in this case suggestion2 - make sure to parse it away afterwards
oracle.add(suggestion3); // Group B

      

+3


source


Your best bet is to use a third party library on GWTQuery - http://jdramaix.github.com/gwtchosen/

You can also try hacking the SuggestBox or ListBox in GWT, but they cannot be raised to a nice polished gui level like in GwtChosen.

+2


source







All Articles