Search in sources :

Example 1 with RegisterUserClickListener

use of com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener in project cia by Hack23.

the class MainViewRegisterPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ANONYMOUS" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    final String pageId = getPageId(parameters);
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    final VerticalLayout registerLayout = new VerticalLayout();
    registerLayout.setSizeFull();
    final Panel formPanel = new Panel();
    formPanel.setSizeFull();
    registerLayout.addComponent(formPanel);
    final FormLayout formContent = new FormLayout();
    formPanel.setContent(formContent);
    final RegisterUserRequest reqisterRequest = new RegisterUserRequest();
    reqisterRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
    reqisterRequest.setUsername("");
    reqisterRequest.setEmail("");
    reqisterRequest.setCountry("");
    reqisterRequest.setUserpassword("");
    final ClickListener reqisterListener = new RegisterUserClickListener(reqisterRequest);
    getFormFactory().addRequestInputFormFields(formContent, reqisterRequest, RegisterUserRequest.class, AS_LIST, REGISTER, reqisterListener);
    final VerticalLayout overviewLayout = new VerticalLayout();
    overviewLayout.setSizeFull();
    content.addComponent(overviewLayout);
    content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
    final ResponsiveRow grid = createGridLayout(overviewLayout);
    createRowComponent(grid, registerLayout, "Register a new user");
    panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MAIN_VIEW, ApplicationEventGroup.USER, CommonsViews.MAIN_VIEW_NAME, parameters, pageId);
    return content;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) Panel(com.vaadin.ui.Panel) RegisterUserRequest(com.hack23.cia.service.api.action.application.RegisterUserRequest) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) VerticalLayout(com.vaadin.ui.VerticalLayout) RegisterUserClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener) ClickListener(com.vaadin.ui.Button.ClickListener) RegisterUserClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

RegisterUserRequest (com.hack23.cia.service.api.action.application.RegisterUserRequest)1 RegisterUserClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener)1 ResponsiveRow (com.jarektoro.responsivelayout.ResponsiveRow)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 FormLayout (com.vaadin.ui.FormLayout)1 Panel (com.vaadin.ui.Panel)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Secured (org.springframework.security.access.annotation.Secured)1