Example usage for org.apache.wicket.ajax.markup.html.form AjaxCheckBox AjaxCheckBox

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

Introduction

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

Prototype

public AjaxCheckBox(final String id) 

Source Link

Document

Construct.

Usage

From source file:com.francetelecom.clara.cloud.presentation.designer.services.internalMom.LogicalInternalMomServicePanel.java

License:Apache License

private void initComponents() {

    getServiceForm().add(new CacheActivatedImage("logicalInternalMomIcon",
            new ResourceModel("internalMom-icon").getObject()));
    // Online help link
    String completeHelpUrl = "";
    try {//from ww  w .ja  v  a2 s.co  m
        completeHelpUrl = new StringResourceModel("portal.designer.logical.service.online_manual.baseUrl", null)
                .getString()
                + new StringResourceModel(
                        "portal.designer.logical.service.online_manual." + getLogicalModelType(), null)
                                .getString();
    } catch (Exception e) {
        //do nothing
    }
    ExternalLink onlineHelpLink = new ExternalLink("onlineHelpLink", completeHelpUrl);
    getServiceForm().add(onlineHelpLink);
    if (completeHelpUrl.isEmpty()) {
        onlineHelpLink.setVisible(false);
    }

    // FUNCTIONNAL PARAMETERS
    RequiredTextField<String> serviceLabel = new RequiredTextField<String>("label");
    serviceLabel.setLabel(new StringResourceModel("portal.designer.service.mom.ml.label", null));
    serviceLabel.add(new PropertyValidator<>());
    getServiceForm().add(serviceLabel);

    TextField<String> destinationName = new TextField<String>("destinationName");
    //add help tooltip
    destinationName.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.ml.destinationName.help", null)));
    destinationName.setLabel(new StringResourceModel("portal.designer.service.mom.ml.destinationName", null));
    destinationName.add(new PropertyValidator<>());
    getServiceForm().add(destinationName);

    // Connection factory JNDI Name
    TextField<String> jmsConnectionFactoryJndiName = new TextField<String>("jmsConnectionFactoryJndiName");
    //add help tooltip
    jmsConnectionFactoryJndiName.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.ml.jmsConnectionFactoryJndiName.help", null)));
    jmsConnectionFactoryJndiName.setLabel(
            new StringResourceModel("portal.designer.service.mom.ml.jmsConnectionFactoryJndiName", null));
    jmsConnectionFactoryJndiName.add(new PropertyValidator<>());
    getServiceForm().add(jmsConnectionFactoryJndiName);

    // Non Functionnal attributes
    // Max size Kb
    TextField msgMaxSizeKB = new TextField("msgMaxSizeKB");
    //add help tooltip
    msgMaxSizeKB.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.ml.msgMaxSizeKB.help", null)));
    msgMaxSizeKB.setLabel(new StringResourceModel("portal.designer.service.mom.ml.msgMaxSizeKB", null));
    msgMaxSizeKB.add(new PropertyValidator<>());
    getServiceForm().add(msgMaxSizeKB);

    // destination capacity (nb msg)
    TextField destinationCapacity = new TextField("destinationCapacity");
    //add help tooltip
    destinationCapacity.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.ml.destinationCapacity.help", null)));
    destinationCapacity
            .setLabel(new StringResourceModel("portal.designer.service.mom.ml.destinationCapacity", null));
    destinationCapacity.add(new PropertyValidator<>());
    getServiceForm().add(destinationCapacity);

    // Persistent message used
    CheckBox persistentMessagesUsed = new CheckBox("persistentMessagesUsed");
    persistentMessagesUsed
            .setLabel(new StringResourceModel("portal.designer.service.mom.ml.persistentMessagesUsed", null));
    persistentMessagesUsed.add(new PropertyValidator<>());
    getServiceForm().add(persistentMessagesUsed);

    // High availability
    CheckBox highAvailability = new CheckBox("highAvailability");
    highAvailability.setLabel(new StringResourceModel("portal.designer.service.mom.ml.highAvailability", null));
    highAvailability.setEnabled(false);
    //add help tooltip
    highAvailability.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.ml.highAvailability.help", null)));
    highAvailability.add(new PropertyValidator<>());
    getServiceForm().add(highAvailability);

    // Dead Letter
    // jndi queue name
    deadLetterQueueName = new TextField<String>("deadLetterQueueName", String.class);
    //add help tooltip
    deadLetterQueueName.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.dl.deadLetterQueueName.help", null)));
    deadLetterQueueName.setOutputMarkupId(true);
    deadLetterQueueName.add(new PropertyValidator<>());
    //        deadLetterQueueName.setLabel(new StringResourceModel("portal.designer.service.mom.dl.deadLetterQueueName",null));

    // queue capacity
    deadLetterQueueCapacity = new TextField("deadLetterQueueCapacity");
    //add help tooltip
    deadLetterQueueCapacity.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.dl.deadLetterQueueCapacity.help", null)));
    deadLetterQueueCapacity.setOutputMarkupId(true);
    deadLetterQueueCapacity.add(new PropertyValidator<>());
    //        deadLetterQueueCapacity.setLabel(new StringResourceModel("portal.designer.service.mom.dl.deadLetterQueueCapacity",null));

    // retries before deadqueue
    retriesBeforeMovingToDeadLetterQueue = new TextField("retriesBeforeMovingToDeadLetterQueue");
    //add help tooltip
    retriesBeforeMovingToDeadLetterQueue.add(new AttributeModifier("title", new StringResourceModel(
            "portal.designer.service.mom.dl.retriesBeforeMovingToDeadLetterQueue.help", null)));
    //        retriesBeforeMovingToDeadLetterQueue.setLabel(new StringResourceModel("portal.designer.service.mom.dl.retriesBeforeMovingToDeadLetterQueue",null));
    retriesBeforeMovingToDeadLetterQueue.setOutputMarkupId(true);
    retriesBeforeMovingToDeadLetterQueue.add(new PropertyValidator<>());

    // enable dead letter queue
    hasDeadLetterQueue = new AjaxCheckBox("hasDeadLetterQueue") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            deadLetterQueueName.setEnabled(getModelObject());
            deadLetterQueueCapacity.setEnabled(getModelObject());
            retriesBeforeMovingToDeadLetterQueue.setEnabled(getModelObject());

            target.add(deadLetterQueueName);
            target.add(deadLetterQueueCapacity);
            target.add(retriesBeforeMovingToDeadLetterQueue);
        }
    };
    hasDeadLetterQueue
            .setLabel(new StringResourceModel("portal.designer.service.mom.dl.hasDeadLetterQueue", null));
    hasDeadLetterQueue.add(new AttributeModifier("title",
            new StringResourceModel("portal.designer.service.mom.dl.hasDeadLetterQueue.help", null)));
    getServiceForm().add(hasDeadLetterQueue);

    if (hasDeadLetterQueue.getModelObject() != null) {
        deadLetterQueueName.setEnabled(hasDeadLetterQueue.getModelObject());
        deadLetterQueueCapacity.setEnabled(hasDeadLetterQueue.getModelObject());
        retriesBeforeMovingToDeadLetterQueue.setEnabled(hasDeadLetterQueue.getModelObject());
    }

    getServiceForm().add(retriesBeforeMovingToDeadLetterQueue);
    getServiceForm().add(deadLetterQueueCapacity);
    getServiceForm().add(deadLetterQueueName);

}

From source file:com.servoy.extensions.beans.dbtreeview.table.DBTreeTableTreeNode.java

License:Open Source License

protected Component newCheckboxComponent(String componentId, final AbstractTree tree, final IModel model) {

    AjaxCheckBox cb = new AjaxCheckBox(componentId) {

        @Override/*from ww w  .j  av  a  2s.  c  om*/
        protected void onUpdate(AjaxRequestTarget target) {
            if (model.getObject() instanceof FoundSetTreeModel.UserNode) {
                onNodeCheckboxClicked((TreeNode) model.getObject(), tree, target);
            }
        }

        @Override
        public String getModelValue() {
            if (model.getObject() instanceof FoundSetTreeModel.UserNode) {
                return ((FoundSetTreeModel.UserNode) model.getObject()).isCheckBoxChecked() ? "true" : "false";
            }

            return "false";
        }

    };

    if (model.getObject() instanceof FoundSetTreeModel.UserNode) {
        cb.setVisible(((FoundSetTreeModel.UserNode) model.getObject()).hasCheckBox());
        if (!((FoundSetTreeModel.UserNode) model.getObject()).isCheckBoxEnabled())
            cb.add(new AttributeModifier("disabled", true, new Model("disabled")));
    } else {
        cb.setVisible(false);
    }

    return cb;
}

From source file:com.servoy.extensions.beans.dbtreeview.WicketDBTreeViewNode.java

License:Open Source License

protected Component newCheckboxComponent(String componentId, final BaseTree tree, final IModel model) {

    AjaxCheckBox cb = new AjaxCheckBox(componentId) {

        @Override//from  w  ww. jav  a  2  s . co  m
        protected void onUpdate(AjaxRequestTarget target) {
            if (model.getObject() instanceof FoundSetTreeModel.UserNode) {
                onNodeCheckboxClicked((TreeNode) model.getObject(), tree, target);
            }
        }

        @Override
        public String getModelValue() {
            if (model.getObject() instanceof FoundSetTreeModel.UserNode) {
                return ((FoundSetTreeModel.UserNode) model.getObject()).isCheckBoxChecked() ? "true" : "false";
            }

            return "false";
        }

    };

    if (model.getObject() instanceof FoundSetTreeModel.UserNode) {
        cb.setVisible(((FoundSetTreeModel.UserNode) model.getObject()).hasCheckBox());
        if (!((FoundSetTreeModel.UserNode) model.getObject()).isCheckBoxEnabled())
            cb.add(new AttributeModifier("disabled", true, new Model("disabled")));
    } else {
        cb.setVisible(false);
    }

    return cb;
}

From source file:com.userweave.pages.user.overview.UserOverviewPanel.java

License:Open Source License

private void initUI() {
    LoadableDetachableModel userListModel = new LoadableDetachableModel() {

        @Override//ww w .  j  a  va2  s.  c  o  m
        protected Object load() {
            /*
             * GroupingComparator comparator = GroupingComparator .build(new
             * Comparator[] { new StudyStateComparator(), new
             * EntityBaseComparator() }); Set<Study> sorted = new TreeSet<Study>(comparator);
             * User user = UserWeaveSession.get().getUser();
             * if(user.isAdmin()) { sorted.addAll(studyDao.findAll()); }
             * else { sorted.addAll(studyDao.findByOwner(user)); } return
             * new ArrayList<Study>(sorted);
             */
            return userDao.findAllByEmail();
        }
    };

    add(new AjaxLink("create") {
        @Override
        public void onClick(AjaxRequestTarget target) {
            onEditUser(target, null);
        }
    });

    add(new ListView("listview", userListModel) {

        @Override
        protected IModel getListItemModel(IModel model, int index) {
            IModel listItemModel = super.getListItemModel(model, index);
            final int userId = ((User) listItemModel.getObject()).getId();

            return new CompoundPropertyModel(new LoadableDetachableModel() {

                @Override
                protected Object load() {
                    return userDao.findById(userId);
                }
            });
        }

        @Override
        protected void populateItem(final ListItem item) {
            final int userId = ((User) item.getModelObject()).getId();

            item.add(new AjaxLink("edit") {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    onEditUser(target, userId);
                }
            }.add(new Label("email")));

            item.add(new AjaxCheckBox("subscription") {

                @Override
                protected void onUpdate(AjaxRequestTarget target) {
                    User cur = ((User) item.getModelObject());
                    userDao.save(cur);
                }

                @Override
                public boolean isVisible() {
                    return !((User) item.getModelObject()).isAdmin();
                }
            });

            item.add(
                    new Label("subscription_label", new StringResourceModel("subscription_label", this, null)) {
                        @Override
                        public boolean isVisible() {
                            return !((User) item.getModelObject()).isAdmin();
                        }
                    });

            if (item.getIndex() == 0) {
                item.add(new SimpleAttributeModifier("class", "even_first"));
            } else if (isOdd)
                item.add(new SimpleAttributeModifier("class", "odd"));
            else
                item.add(new SimpleAttributeModifier("class", "even"));

            isOdd = !isOdd;

            /*
             * Link deleteLink = new DeleteLink("delete", item);
             * 
             * deleteLink.add(new SimpleAttributeModifier("onclick", "return
             * confirm('Are you sure?');"));
             * 
             * item.add(deleteLink);
             */
        }
    });
}

From source file:com.userweave.pages.user.verification.UserVerificationForm.java

License:Open Source License

public UserVerificationForm(String id, IModel userModel, final ModalWindow agbModalWindow) {
    super(id);/*from  ww w  .j  av a 2 s  .  co m*/

    setModel(new CompoundPropertyModel(userModel));

    AjaxCheckBox acb = new AjaxCheckBox("verified") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            toggleVisibility(this, target);
        }
    };

    add(acb);

    add(new AjaxLink("agb") {

        @Override
        public void onClick(AjaxRequestTarget target) {
            agbModalWindow.show(target);
        }

    });

    container = new WebMarkupContainer("container");
    add(container);

    container.setVisible(false);

    container.setOutputMarkupPlaceholderTag(true);

    container.add(new TextField("surname").setRequired(true));
    container.add(new TextField("forename").setRequired(true));

    container.add(createReceiveNewsChoice());

    container.add(new DefaultButton("saveButton", new StringResourceModel("save", this, null), this) {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form form) {
            UserVerificationForm.this.onSave(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form form) {
            target.addComponent(UserVerificationForm.this.get("feedback"));

        }
    });

    addLocaleChoice();

    add(new FeedbackPanel("feedback").setOutputMarkupId(true));
}

From source file:net.rrm.ehour.ui.admin.config.panel.MiscConfigPanel.java

License:Open Source License

private void addMiscComponents(Form<?> form) {
    // show turnover checkbox
    CheckBox showTurnover = new CheckBox("config.showTurnover");
    showTurnover.setMarkupId("showTurnover");
    form.add(showTurnover);//from w  ww  .jav a 2  s  . c om

    final MainConfigBackingBean configBackingBean = (MainConfigBackingBean) getDefaultModelObject();

    // working hours
    TextField<Float> workHours = new TextField<>("config.completeDayHours", Float.class);
    workHours.setLabel(new ResourceModel("admin.config.workHours"));
    workHours.add(new ValidatingFormComponentAjaxBehavior());
    workHours.add(RangeValidator.minimum(0f));
    workHours.add(RangeValidator.maximum(24f));
    workHours.setRequired(true);
    form.add(new AjaxFormComponentFeedbackIndicator("workHoursValidationError", workHours));
    form.add(workHours);

    // weeks start at
    DropDownChoice<Date> weekStartsAt;
    weekStartsAt = new DropDownChoice<>("firstWeekStart", DateUtil
            .createDateSequence(DateUtil.getDateRangeForWeek(new GregorianCalendar()), new EhourConfigStub()),
            new WeekDayRenderer(configBackingBean.getLocaleLanguage()));
    form.add(weekStartsAt);

    // Timezone
    DropDownChoice<String> timezone = new DropDownChoice<>("config.timeZone",
            Lists.newArrayList(DateTimeZone.getAvailableIDs()));
    form.add(timezone);

    // pm access rights
    form.add(new DropDownChoice<>("config.pmPrivilege", Arrays.asList(PmPrivilege.values()),
            new EnumChoiceRenderer<PmPrivilege>()));

    // split admin role
    final Container convertManagersContainer = new Container("convertManagers");
    DropDownChoice<UserRole> convertManagersTo = new DropDownChoice<>("convertManagersTo",
            Lists.newArrayList(UserRole.ADMIN, UserRole.USER), new UserRoleRenderer());
    convertManagersContainer.add(convertManagersTo);
    convertManagersContainer.setVisible(false);
    form.add(convertManagersContainer);

    AjaxCheckBox withManagerCheckbox = new AjaxCheckBox("config.splitAdminRole") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            Boolean managersEnabled = this.getModelObject();

            boolean showConvert = !managersEnabled && !userService.getUsers(UserRole.MANAGER).isEmpty();

            if (convertManagersContainer.isVisible() != showConvert) {
                convertManagersContainer.setVisible(showConvert);
                target.add(convertManagersContainer);
            }
        }
    };
    withManagerCheckbox.setMarkupId("splitAdminRole");

    form.add(withManagerCheckbox);
}

From source file:net.rrm.ehour.ui.report.panel.criteria.ReportCriteriaPanel.java

License:Open Source License

private void addCustomerSelection(final ReportCriteriaBackingBean bean, WebMarkupContainer parent) {
    customers = new ListMultipleChoice<>("reportCriteria.userSelectedCriteria.customers",
            new PropertyModel<Collection<Customer>>(bean, "reportCriteria.userSelectedCriteria.customers"),
            new PropertyModel<List<Customer>>(bean, "reportCriteria.availableCriteria.customers"),
            new DomainObjectChoiceRenderer<Customer>());
    customers.setMarkupId("customerSelect");
    customers.setMaxRows(MAX_CRITERIA_ROW);

    customers.setOutputMarkupId(true);//from   w  w w  .j  av  a 2  s.c o m

    customers.add(new AjaxFormComponentUpdatingBehavior("change") {
        private static final long serialVersionUID = -5588313671121851508L;

        protected void onUpdate(AjaxRequestTarget target) {
            // show only projects for selected customers
            List<Customer> preCustomers = Lists
                    .newArrayList(bean.getReportCriteria().getAvailableCriteria().getCustomers());

            updateReportCriteria(ReportCriteriaUpdateType.UPDATE_CUSTOMERS_AND_PROJECTS);

            List<Customer> postCustomers = bean.getReportCriteria().getAvailableCriteria().getCustomers();

            if (!preCustomers.containsAll(postCustomers)) {
                updateCustomers(target);
            }
            updateProjects(target);
        }
    });

    parent.add(customers);

    final AjaxCheckBox deactivateBox = new AjaxCheckBox(
            "reportCriteria.userSelectedCriteria.onlyActiveCustomers") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            updateCustomersAndProjects(target);
        }
    };
    deactivateBox.setOutputMarkupId(true);
    parent.add(deactivateBox);

    final DropDownChoice<Sort> customerSort = createCustomerSort();
    parent.add(customerSort);

    parent.add(new AjaxLink<Void>("clearCustomer") {
        @Override
        public void onClick(AjaxRequestTarget target) {
            bean.getReportCriteria().getUserSelectedCriteria().resetCustomerSelection();

            updateReportCriteria(ReportCriteriaUpdateType.UPDATE_CUSTOMERS_AND_PROJECTS);

            updateCustomers(target);
            updateProjects(target);

            target.appendJavaScript(getCustomerFilterClearScript());

            target.add(customerSort);
            target.add(deactivateBox);
        }
    });
}

From source file:net.rrm.ehour.ui.report.panel.criteria.ReportCriteriaPanel.java

License:Open Source License

private void addProjectSelection(final ReportCriteriaBackingBean bean, WebMarkupContainer parent) {
    projects = new ListMultipleChoice<>("reportCriteria.userSelectedCriteria.projects",
            new PropertyModel<List<Project>>(bean, "reportCriteria.availableCriteria.projects"),
            new DomainObjectChoiceRenderer<Project>());
    projects.setMaxRows(MAX_CRITERIA_ROW);
    projects.setOutputMarkupId(true);/*from  w  w w.  ja  v  a 2  s  .c o  m*/
    projects.setMarkupId("projectSelect");

    projects.add(new AjaxFormComponentUpdatingBehavior("change") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {

        }
    });

    parent.add(projects);

    final AjaxCheckBox onlyActiveCheckbox = new AjaxCheckBox(
            "reportCriteria.userSelectedCriteria.onlyActiveProjects") {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            updateReportCriteria(ReportCriteriaUpdateType.UPDATE_CUSTOMERS_AND_PROJECTS);
            updateCustomers(target);
            updateProjects(target);
        }
    };
    onlyActiveCheckbox.setOutputMarkupId(true);
    parent.add(onlyActiveCheckbox);

    final AjaxCheckBox billableCheckbox = new AjaxCheckBox(
            "reportCriteria.userSelectedCriteria.onlyBillableProjects",
            new PropertyModel<Boolean>(ReportCriteriaPanel.this.getDefaultModel(),
                    "reportCriteria.userSelectedCriteria.onlyBillableProjects")) {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            updateReportCriteria(ReportCriteriaUpdateType.UPDATE_CUSTOMERS_AND_PROJECTS);
            updateProjects(target);
        }
    };

    billableCheckbox.setMarkupId("reportCriteria.userSelectedCriteria.onlyBillableProjects");
    billableCheckbox.setOutputMarkupId(true);
    parent.add(billableCheckbox);

    final DropDownChoice<Sort> projectSort = createProjectSort();
    parent.add(projectSort);

    parent.add(new AjaxLink<Void>("clearProject") {
        @Override
        public void onClick(AjaxRequestTarget target) {
            bean.getReportCriteria().getUserSelectedCriteria().resetProjectSelection();

            updateReportCriteria(ReportCriteriaUpdateType.UPDATE_CUSTOMERS_AND_PROJECTS);

            updateCustomers(target);
            updateProjects(target);

            target.appendJavaScript(getProjectFilterClearScript());

            target.add(projectSort);
            target.add(billableCheckbox);
            target.add(onlyActiveCheckbox);
        }
    });
}

From source file:net.rrm.ehour.ui.report.panel.criteria.ReportCriteriaPanel.java

License:Open Source License

private void addUserSelection(final ReportCriteriaBackingBean bean, WebMarkupContainer parent) {
    users = new ListMultipleChoice<>("reportCriteria.userSelectedCriteria.users",
            new PropertyModel<List<User>>(getDefaultModel(), "reportCriteria.availableCriteria.users"),
            new DomainObjectChoiceRenderer<User>());
    users.setMarkupId("userSelect");
    users.setOutputMarkupId(true);//  w w  w  . j  a  v a 2s  . com
    users.setMaxRows(MAX_CRITERIA_ROW);
    parent.add(users);

    // hide active checkbox
    final AjaxCheckBox deactivateBox = new AjaxCheckBox("reportCriteria.userSelectedCriteria.onlyActiveUsers") {
        private static final long serialVersionUID = 2585047163449150793L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            updateReportCriteria(ReportCriteriaUpdateType.UPDATE_USERS_AND_DEPTS);
            target.add(users);

            // reapply the filter to the possible new contents of the dropdowns
            target.appendJavaScript(getUserFilterRegistrationScript());
        }
    };

    parent.add(deactivateBox);

    Label filterToggleText = new Label("onlyActiveUsersLabel", new ResourceModel("report.onlyActiveUsers"));
    parent.add(filterToggleText);

    parent.add(new AjaxLink<Void>("clearUser") {
        @Override
        public void onClick(AjaxRequestTarget target) {
            bean.getReportCriteria().getUserSelectedCriteria().resetUserSelection();

            updateReportCriteria(ReportCriteriaUpdateType.UPDATE_USERS_AND_DEPTS);

            updateUsers(target);
            updateDepartments(target);

            target.appendJavaScript(getUserFilterClearScript());
        }
    });
}

From source file:org.apache.karaf.webconsole.osgi.core.bundle.install.InstallBundlePanel.java

License:Apache License

public InstallBundlePanel(String id, IModel<WicketInstallModel> model) {
    super(id);//from ww w.j a v a  2  s  .  c o  m

    Form<WicketInstallModel> form = new Form<WicketInstallModel>("form",
            new CompoundPropertyModel<WicketInstallModel>(model));
    location = new RequiredTextField<String>("location");
    location.setLabel(of("Bundle location"));
    LabelBorder border = new LabelBorder("locationGroup", location);
    form.add(border);

    upload = new AjaxCheckBox("upload") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            if (target != null) {
                if (upload.getModelObject()) {
                    onChecked();
                } else {
                    onUnchecked();
                }
                target.add(file);
            }
        }
    };
    upload.setLabel(of("Specify file to install"));
    border = new LabelBorder("uploadGroup", upload);
    form.add(border);

    file = new FileUploadField("file");
    file.setLabel(of("Bundle file"));
    file.add(new AttributeModifier("disabled", "disabled"));
    file.setOutputMarkupId(true);
    border = new LabelBorder("fileGroup", file);
    form.add(border);

    add(form);
}