public void render(Node parent) {
GridRow row = new GridRow();
row.add(new GridEntry("u-7-24", "left"));
row.add(new GridEntry("u-17-24", "right"));
row.render(y, parent);
Node leftPanel = row.getSource().one(".left"), rightPanel = row.getSource().one(".right");
editorPanel = rightPanel.appendChild("<div></div>");
y.newButton(ButtonConfig.create().label("Add new " + entityName).render(leftPanel).on("click", new EventCallback<ButtonEvent>() {
@Override
public void call(ButtonEvent e) {
doAddNewEntity();
}
}));
y.newButton(ButtonConfig.create().label("Show All " + entityName +"s").render(leftPanel).on("click", new EventCallback<ButtonEvent>() {
@Override
public void call(ButtonEvent e) {
JsArray<JavaScriptObject> data = getDataTableData(all);
resultTable.data(data);
resultTable.caption("All "+entityName+"s");
}
}));
parent.append("<p></p>"); //separator
y.newButton(ButtonConfig.create().label("Search " + entityName +"s").render(leftPanel).on("click", new EventCallback<ButtonEvent>() {
@Override
public void call(ButtonEvent e) {
String keywords = ac.value();
List<T> results = search(keywords);
JsArray dtResults = toDataTableSource(results);
resultTable.data(dtResults);
resultTable.render();
resultTable.caption("results for "+keywords);
}
}));
acInput = leftPanel.appendChild("<input type=\"text\"></input>");
ac = y.newAutoComplete(AutoCompleteConfig.create()
.resultHighlighter("phraseMatch").resultFilters("phraseMatch")
.inputNode(acInput)
// .source(getAllAutocompleteNames()
);