@com.vaadin.flow.router.Route(com.vaadin.flow.uitest.ui.RequestParametersHistoryView)

Here are the examples of the java api @com.vaadin.flow.router.Route(com.vaadin.flow.uitest.ui.RequestParametersHistoryView) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : RequestParametersHistoryView.java
with MIT License
from mcollovati

/**
 * @author Vaadin Ltd
 * @since 1.0.
 */
@Route("com.vaadin.flow.uitest.ui.RequestParametersHistoryView")
public clreplaced RequestParametersHistoryView extends AbstractDivView {

    static final String REQUEST_PARAM_NAME = "testRequestParam";

    static final String NO_INPUT_TEXT = "No input";

    static final String REQUEST_PARAM_ID = "requestParamDisplayLabel";

    static final String BACK_BUTTON_ID = "backButton";

    private final Label requestParamLabel;

    public RequestParametersHistoryView() {
        NativeButton backwardButton = createButton("Go back", BACK_BUTTON_ID, event -> getPage().getHistory().back());
        requestParamLabel = new Label(NO_INPUT_TEXT);
        requestParamLabel.setId(REQUEST_PARAM_ID);
        add(requestParamLabel, backwardButton);
        String[] params = VaadinService.getCurrentRequest().getParameterMap().getOrDefault(REQUEST_PARAM_NAME, new String[0]);
        if (params == null || params.length == 0) {
            requestParamLabel.setText(NO_INPUT_TEXT);
        } else {
            requestParamLabel.setText(params[0]);
        }
    }
}