Tuesday, April 16, 2019

Re: SuggestBox in a CellTable

Hi Craig,

I'm trying to place the SuggestBox widget inside CellTable.
Created the custom class "SuggestBoxTextInputCell" which extends the TextInputCell.


And changed the browserEvent as following:

public void onBrowserEvent(Context context, Element parent, String value,

NativeEvent event, ValueUpdater<String> valueUpdater) {

super.onBrowserEvent(context, parent, value, event, valueUpdater);

// Ignore events that don't target the input.

InputElement input = getInputElement(parent);

String eventType = event.getType();

if (BrowserEvents.FOCUS.equals(eventType)) {

TextBox textBox = new MyTextBox(input);

suggestBox = new MySuggestBox(suggestBox.getSuggestOracle(), textBox);

suggestBox.onAttach();

}

Element target = event.getEventTarget().cast();

}



But I want to pass my own suggestionText.

Hence the created a constructor:

public SuggestBoxTextInputCell(MultiWordSuggestOracle suggestions) {

this(suggestions, new TextBox());

}

public SuggestBoxTextInputCell(MultiWordSuggestOracle suggestions,

ValueBoxBase<String> box) {

//this(suggestions, box);

}


After this I'm stuck.

And want to call SuggestBoxTextInputCell(Suggestions) in CellTable.

On Tuesday, April 16, 2019 at 6:06:10 AM UTC+5:30, Craig Mitchell wrote:
It would help knowing what the problem is, as we don't know what your custom SuggestBox is.

Maybe look into http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCustomDataGrid and look how EditTextCell works, and then make a EditSuggestBox.

--
You received this message because you are subscribed to the Google Groups "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment