How to set the button id in ProcActionsFragment?
At the moment I am attached to the name of the button. I would like to get away from this, since the button can be renamed.
private void clickFragmentButtonHandler() {
Component componentActionBoxButtons = procActionsFragment.getFragment().getComponent("actionsBox");
if (componentActionBoxButtons != null) {
VBoxLayout vBoxLayout = (VBoxLayout) componentActionBoxButtons;
if ((vBoxLayout.getComponents().size() != 0) && (procActionsFragment.getStartProcessAction() == null)) {
Optional<Component> optionalComponentForMove = vBoxLayout.getComponents().stream().filter(component -> {
Button button = (Button) component;
CompleteProcTaskAction action = (CompleteProcTaskAction) button.getAction();
return action.getOutcome().equals("button");
}).findAny();
if (optionalComponentForMove.isPresent()) {
Button choiceBtn = (Button) optionalComponentForMove.get();
choiceBtn.addClickListener(clickEvent -> showScreenChangeDate());
}
}
}
}