Search in sources :

Example 1 with Button

use of org.jboss.errai.common.client.dom.Button in project kie-wb-common by kiegroup.

the class AssigneeEditorWidgetViewImpl method add.

@Override
public void add(AssigneeListItem listItem) {
    HTMLElement tableRow = document.createElement("tr");
    HTMLElement liveSearchTd = document.createElement("td");
    listItem.getLiveSearchDropDown().asWidget().getElement().getStyle().setWidth(100, Style.Unit.PCT);
    DOMUtil.appendWidgetToElement(liveSearchTd, listItem.getLiveSearchDropDown());
    HTMLElement actionTd = document.createElement("td");
    Button button = (Button) document.createElement("button");
    button.setClassName("btn btn-link fa fa-trash");
    button.addEventListener("click", event -> {
        listItem.notifyRemoval();
        DOMUtil.removeFromParent(tableRow);
    }, false);
    actionTd.appendChild(button);
    tableRow.appendChild(liveSearchTd);
    tableRow.appendChild(actionTd);
    assigneeRows.appendChild(tableRow);
    elements.put(listItem, tableRow);
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Button(org.jboss.errai.common.client.dom.Button)

Aggregations

Button (org.jboss.errai.common.client.dom.Button)1 HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)1