Example usage for org.apache.wicket.markup.html.form DropDownChoice DropDownChoice

List of usage examples for org.apache.wicket.markup.html.form DropDownChoice DropDownChoice

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form DropDownChoice DropDownChoice.

Prototype

public DropDownChoice(String id, IModel<? extends List<? extends T>> choices,
        IChoiceRenderer<? super T> renderer) 

Source Link

Document

Constructor.

Usage

From source file:at.ac.tuwien.ifs.tita.ui.administration.project.IssueTrackerProjectForm.java

License:Apache License

/**
 * displays the Table of issueTrackerProjects.
 *//*from   ww  w  .j a  v a2 s.co  m*/
private void addComponents() {
    addOrReplace(new TextField<String>("tfProjectName",
            new PropertyModel<String>(issueTrackerProject, "projectName")));
    addOrReplace(new DropDownChoice<IssueTracker>("dropDownIssueTracker",
            new PropertyModel<IssueTracker>(issueTrackerProject, "issueTracker"), issueTracker));
    // addOrReplace(new CheckBox("checkBoxDeletedIssueTrackerProject", new
    // PropertyModel<Boolean>(issueTrackerProject,
    // "deleted")));
}

From source file:at.ac.tuwien.ifs.tita.ui.administration.project.ProjectForm.java

License:Apache License

/**
 * add all controls./*from ww w .j a  v  a  2s . c o m*/
 */
private void addComponents() {

    log.info("Adding Controls to the Form");

    addOrReplace(new TextField<String>("tfDescription", new PropertyModel<String>(project, "description")));
    addOrReplace(new TextField<String>("tfName", new PropertyModel<String>(project, "name")));
    addOrReplace(new CheckBox("checkBoxDeleted", new PropertyModel<Boolean>(project, "deleted")));
    addOrReplace(new DropDownChoice<ProjectStatus>("dropDownProjectStatus",
            new PropertyModel<ProjectStatus>(project, "projectStatus"), projectStati));

    issueTrackerProjectTM = new TableModelIssueTrackerProject(this.issueTrackerProjects);
    issueTrackerProjectTable = new Table("issueTrackerProjectTable", issueTrackerProjectTM);

    DeleteRenderer deleteRenderer = new DeleteRenderer();
    issueTrackerProjectTable.setDefaultRenderer(ButtonDelete.class, deleteRenderer);
    issueTrackerProjectTable.setDefaultEditor(ButtonDelete.class, deleteRenderer);

    addOrReplace(issueTrackerProjectTable);

    // other components will not be displayed, they are not part of the
    // ProjectAdministration
}

From source file:at.ac.tuwien.ifs.tita.ui.administration.user.IssueTrackerLoginForm.java

License:Apache License

/**
 * Method for Adding the Fields to the Form.
 *//*from w  w w .j a v a2s . c o  m*/
private void addComponents() {
    addOrReplace(new TextField<String>("tfIssueTrackerUserName",
            new PropertyModel<String>(issueTrackerLogin, "userName")));
    addOrReplace(new PasswordTextField("ptfIssueTrackerPassword",
            new PropertyModel<String>(issueTrackerLogin, "password")));

    addOrReplace(new DropDownChoice<IssueTracker>("dropDownIssueTracker",
            new PropertyModel<IssueTracker>(issueTrackerLogin, "issueTracker"), availableIssueTracker));
}

From source file:at.ac.tuwien.ifs.tita.ui.administration.user.UserForm.java

License:Apache License

/**
 * Method for Adding the Fields to the Form.
 *///  w  w  w  . j av a  2 s . c  om
private void addComponents() {

    addOrReplace(new TextField<String>("tfUserName", new PropertyModel<String>(user, "userName")));
    addOrReplace(new TextField<String>("tfFirstName", new PropertyModel<String>(user, "firstName")));
    addOrReplace(new TextField<String>("tfLastName", new PropertyModel<String>(user, "lastName")));
    addOrReplace(new TextField<String>("tfEmail", new PropertyModel<String>(user, "email")));

    ptfPassword = new PasswordTextField("ptfPassword", new PropertyModel<String>(user, "password"));
    ptfPassword.setRequired(false);
    addOrReplace(ptfPassword);

    ptfPasswordRepetition = new PasswordTextField("ptfPasswordRepetition",
            new PropertyModel<String>(this, "passwordRepetition"));
    ptfPasswordRepetition.setRequired(false);
    addOrReplace(ptfPasswordRepetition);

    addOrReplace(new CheckBox("checkBoxDeleted", new PropertyModel<Boolean>(user, "deleted")));

    dropDownrole = new DropDownChoice<Role>("dropDownRole", new PropertyModel<Role>(user, "role"), roles);
    if (user.getRole() != null) {
        dropDownrole.setConvertedInput(user.getRole());
    }
    dropDownrole.setRequired(false);
    addOrReplace(dropDownrole);

    userProjectTM = new TableModelUserProject(titaProjects);
    userProjectTM.reload();
    userProjectTable = new Table(C_USER_PROJECT_TABLE_NAME, userProjectTM);

    issueTrackerLoginTM = new TableModelIssueTrackerLoginWithoutButtons(titaIssueTracker);
    issueTrackerLoginTM.reload();
    issueTrackerLoginTable = new Table(C_ISSUE_TRACKER_TABLE_NAME, issueTrackerLoginTM);

    addOrReplace(issueTrackerLoginTable);
    addOrReplace(userProjectTable);
}

From source file:at.ac.tuwien.ifs.tita.ui.tasklist.TaskListPanel.java

License:Apache License

/**
 * Shows the header and configuration for the tasklist.
 *///from  ww  w  .j  a va  2  s .  co  m
private void displayHeader() {

    dropDownView = new DropDownChoice<String>("dropdownGrouping", new Model<String>(), groupingList) {

        @Override
        protected boolean wantOnSelectionChangedNotifications() {
            return true;
        }

        /**
         * Called when a option is selected of a dropdown list that wants to be
         * notified of this event.
         *
         * @param newSelection The newly selected object of the backing model
         */
        @Override
        protected void onSelectionChanged(final String newSelection) {

        }
    };

    dropDownView.setOutputMarkupId(true);
    dropDownView.setDefaultModelObject(groupingList.get(0));
    dropDownView.setNullValid(false);

    dropDownView.add(new AjaxFormComponentUpdatingBehavior("onchange") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            changeGrouping(project);
            target.addComponent(containerTaskList);
        }
    });

    tasklistForm.add(dropDownView);
    tasklistForm.add(new Label("dummy", ""));
    tasklistForm.add(new AjaxButton("updateTaskList") {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form1) {
            loadIssueTrackerTasks(project);
            target.addComponent(containerTaskList);
        }
    });
    //        general timer panel
    generalTimer = new GeneralTimerPanel("generalTimer", this);
    tasklistForm.add(generalTimer);
}

From source file:au.org.theark.admin.web.component.function.form.DetailForm.java

License:Open Source License

private void initArkFunctionTypeDropDown() {
    List<ArkFunctionType> arkFunctionTypeList = iAdminService.getArkFunctionTypeList();
    ChoiceRenderer<ArkFunctionType> defaultChoiceRenderer = new ChoiceRenderer<ArkFunctionType>("name", "id");
    arkFunctionTypeDropDown = new DropDownChoice<ArkFunctionType>("arkFunction.arkFunctionType",
            arkFunctionTypeList, defaultChoiceRenderer);
}

From source file:au.org.theark.admin.web.component.function.form.SearchForm.java

License:Open Source License

@SuppressWarnings("unchecked")
private void initArkFunctionTypeDropDown() {
    List<ArkFunctionType> arkFunctionTypeList = iAdminService.getArkFunctionTypeList();
    ChoiceRenderer<ArkFunctionType> defaultChoiceRenderer = new ChoiceRenderer<ArkFunctionType>("name", "id");
    arkFunctionTypeDropDown = new DropDownChoice("arkFunction.arkFunctionType", arkFunctionTypeList,
            defaultChoiceRenderer);/*from w  ww.j a  va2  s .c om*/
    arkFunctionTypeDropDown.add(new AjaxFormComponentUpdatingBehavior("onChange") {

        private static final long serialVersionUID = 5591846326218931210L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {

        }
    });
}

From source file:au.org.theark.admin.web.component.modulefunction.form.DetailForm.java

License:Open Source License

private void initArkModuleDropDown() {
    List<ArkModule> arkModuleList = iAdminService.getArkModuleList();
    ChoiceRenderer<ArkModule> defaultChoiceRenderer = new ChoiceRenderer<ArkModule>("name", "id");
    arkModuleDropDown = new DropDownChoice<ArkModule>("arkModuleFunction.arkModule", arkModuleList,
            defaultChoiceRenderer);//from w w w .  j  a  va2  s.c  om
    arkModuleDropDown.setOutputMarkupPlaceholderTag(true);
    arkModuleDropDown.setEnabled(isNew());
}

From source file:au.org.theark.admin.web.component.modulefunction.form.SearchForm.java

License:Open Source License

private void initArkModuleDropDown() {
    List<ArkModule> arkModuleList = iAdminService.getArkModuleList();
    ChoiceRenderer<ArkModule> defaultChoiceRenderer = new ChoiceRenderer<ArkModule>("name", "id");
    arkModuleDropDown = new DropDownChoice<ArkModule>("arkModule", arkModuleList, defaultChoiceRenderer);
    arkModuleDropDown.add(new AjaxFormComponentUpdatingBehavior("onChange") {

        private static final long serialVersionUID = 5591846326218931210L;

        @Override/*from   www . j  av a 2  s .  c  o m*/
        protected void onUpdate(AjaxRequestTarget target) {

        }
    });
    arkModuleDropDown.setOutputMarkupPlaceholderTag(true);
}

From source file:au.org.theark.admin.web.component.modulerole.form.DetailForm.java

License:Open Source License

private void initArkModuleDropDown() {
    List<ArkModule> arkModuleList = iAdminService.getArkModuleList();
    ChoiceRenderer<ArkModule> defaultChoiceRenderer = new ChoiceRenderer<ArkModule>("name", "id");
    arkModuleDropDown = new DropDownChoice<ArkModule>("arkModuleRole.arkModule", arkModuleList,
            defaultChoiceRenderer);//from  w w w  .  ja v a2  s . c o m
    arkModuleDropDown.setOutputMarkupPlaceholderTag(true);
    arkModuleDropDown.setEnabled(isNew());
}