public void cleanFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); clearErrorMessages(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { ((TextBox) groupControl.getWidget(1)).setText(""); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); listBox.setSelectedIndex(-1); } } }
private void initButton(ActionButtonDefinition<T> buttonDef, ActionButton button) { button.setText(buttonDef.getText()); // Set button element ID for better accessibility String buttonId = buttonDef.getUniqueId(); if (buttonId != null) { button.asWidget().getElement().setId( ElementIdUtils.createElementId(getElementId(), buttonId)); } // No insert available so need to remove the kebab and then add it at the end. actionFormGroup.remove(actionKebab); if (buttonDef.getIndex() >= actionFormGroup.getWidgetCount()) { // Add the button at the end actionFormGroup.add(button); actionFormGroup.add(actionKebab); } else { // Re-create ordered button list List<Widget> currentButtons = new ArrayList<>(); for (int i = 0; i < actionFormGroup.getWidgetCount(); i++) { currentButtons.add(actionFormGroup.getWidget(i)); } currentButtons.add(buttonDef.getIndex(), button.asWidget()); // Re-add all buttons actionFormGroup.clear(); currentButtons.forEach(existingButton -> actionFormGroup.add(existingButton)); actionFormGroup.add(actionKebab); } actionItemMap.put(buttonDef, button); }
public void cleanFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); clearErrorMessages(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { ((TextBox) groupControl.getWidget(1)).setText(""); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); listBox.setSelectedIndex(-1); } } }
public void cleanFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); clearErrorMessages(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { ((TextBox) groupControl.getWidget(1)).setText(""); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); listBox.setSelectedIndex(-1); } } }
public void cleanFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); clearErrorMessages(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { ((TextBox) groupControl.getWidget(1)).setText(""); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); listBox.setSelectedIndex(-1); } } }
public void getFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { formValues.put(((TextBox) groupControl.getWidget(1)).getName(), ((TextBox) groupControl.getWidget(1)).getValue()); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); List<String> selectedValues = new ArrayList<String>(); for (int i = 0; i < listBox.getItemCount(); i++) { if (listBox.isItemSelected(i)) { selectedValues.add(listBox.getValue(i)); } } formValues.put(listBox.getName(), selectedValues); } } }
public void getFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { formValues.put(((TextBox) groupControl.getWidget(1)).getName(), ((TextBox) groupControl.getWidget(1)).getValue()); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); List<String> selectedValues = new ArrayList<String>(); for (int i = 0; i < listBox.getItemCount(); i++) { if (listBox.isItemSelected(i)) { selectedValues.add(listBox.getValue(i)); } } formValues.put(listBox.getName(), selectedValues); } } }
public void getFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { formValues.put(((TextBox) groupControl.getWidget(1)).getName(), ((TextBox) groupControl.getWidget(1)).getValue()); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); List<String> selectedValues = new ArrayList<String>(); for (int i = 0; i < listBox.getItemCount(); i++) { if (listBox.isItemSelected(i)) { selectedValues.add(listBox.getValue(i)); } } formValues.put(listBox.getName(), selectedValues); } } }
public void getFormValues(List<FormGroup> controlGroups) { formValues = new HashMap(); for (FormGroup groupControl : controlGroups) { if (groupControl.getWidget(1) instanceof TextBox) { formValues.put(((TextBox) groupControl.getWidget(1)).getName(), ((TextBox) groupControl.getWidget(1)).getValue()); } else if (groupControl.getWidget(1) instanceof ListBox) { ListBox listBox = (ListBox) groupControl.getWidget(1); List<String> selectedValues = new ArrayList<String>(); for (int i = 0; i < listBox.getItemCount(); i++) { if (listBox.isItemSelected(i)) { selectedValues.add(listBox.getValue(i)); } } formValues.put(listBox.getName(), selectedValues); } } }