Re: Problem with SuggextBox as table cell
Hi Christian Pelster ,I watched your code , because I need implement some similar and I could solved your problem , you should modify the method updateViewData
some like this:
private String updateViewData(final Context context, final Element parent, final ViewData viewData,
final boolean isEditing, final NativeEvent event) {
deleteLastPopup ();
//final InputElement input = (InputElement) parent.getFirstChild();
final InputElement input = getInputElement(parent);
final String value = input.getValue();
viewData.setText(value);
viewData.setEditing(isEditing);
SuggestBox suggestBox = suggestBoxes.get(getKeyFromKontext(context));
//suggestBox.removeFromParent();
if (suggestBox != null) {
suggestBox.setText(value);
textBox = new MyTextBox(input);
suggestBox = new SuggestBox(suggestBox.getSuggestOracle(), textBox);
implementarEstilos(suggestBox);
DomEvent.fireNativeEvent(event, textBox);
}
suggestBox.setFocus(true);
return value;
}
you should call a new textBox = new MyTextBox(input); because with this he can found the coordenates where will show the results, also you should add a method deleteLastPopup which delete the last popup of results showed.
this is the method :
private void deleteLastPopup () {
Element popupEmpresaServicio =(Element)Document.get().getBody().getLastChild();
String classNameLastChild=popupEmpresaServicio.getClassName();
if(popupStyleName.equals(classNameLastChild)) {
Document.get().getBody().removeChild(Document.get().getBody().getLastChild());
}
}
always the popup is created in the last part of the code generated there we can found (in my case i can found for the classname) and delete , then the new result will be show
I found other thing which need solve , for show the suggestbox better , if you found others fix or solutions for solve you can put here for improve the code :D
regards,
Jorge Vasquez
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/qglfPMIBaRAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home