Search in sources :

Example 1 with RadioGroup

use of org.apache.wicket.markup.html.form.RadioGroup in project midpoint by Evolveum.

the class PageImportObject method initLayout.

private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);
    ImportOptionsPanel importOptions = new ImportOptionsPanel(ID_IMPORT_OPTIONS, model);
    mainForm.add(importOptions);
    final WebMarkupContainer input = new WebMarkupContainer(ID_INPUT);
    input.setOutputMarkupId(true);
    mainForm.add(input);
    final WebMarkupContainer buttonBar = new WebMarkupContainer(ID_BUTTON_BAR);
    buttonBar.setOutputMarkupId(true);
    mainForm.add(buttonBar);
    final IModel<Integer> groupModel = new Model<Integer>(INPUT_FILE);
    RadioGroup importRadioGroup = new RadioGroup(ID_IMPORT_RADIO_GROUP, groupModel);
    importRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            target.add(input);
            target.add(buttonBar);
        }
    });
    mainForm.add(importRadioGroup);
    Radio fileRadio = new Radio(ID_FILE_RADIO, new Model(INPUT_FILE), importRadioGroup);
    importRadioGroup.add(fileRadio);
    Radio xmlRadio = new Radio(ID_XML_RADIO, new Model(INPUT_XML), importRadioGroup);
    importRadioGroup.add(xmlRadio);
    WebMarkupContainer inputAce = new WebMarkupContainer(ID_INPUT_ACE);
    addVisibileForInputType(inputAce, INPUT_XML, groupModel);
    input.add(inputAce);
    AceEditor aceEditor = new AceEditor(ID_ACE_EDITOR, xmlEditorModel);
    aceEditor.setOutputMarkupId(true);
    inputAce.add(aceEditor);
    WebMarkupContainer inputFileLabel = new WebMarkupContainer(ID_INPUT_FILE_LABEL);
    addVisibileForInputType(inputFileLabel, INPUT_FILE, groupModel);
    input.add(inputFileLabel);
    WebMarkupContainer inputFile = new WebMarkupContainer(ID_INPUT_FILE);
    addVisibileForInputType(inputFile, INPUT_FILE, groupModel);
    input.add(inputFile);
    FileUploadField fileInput = new FileUploadField(ID_FILE_INPUT);
    inputFile.add(fileInput);
    initButtons(buttonBar, groupModel);
}
Also used : RadioGroup(org.apache.wicket.markup.html.form.RadioGroup) Form(org.apache.wicket.markup.html.form.Form) Radio(org.apache.wicket.markup.html.form.Radio) AceEditor(com.evolveum.midpoint.web.component.AceEditor) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) FileUploadField(org.apache.wicket.markup.html.form.upload.FileUploadField) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ImportOptionsPanel(com.evolveum.midpoint.web.page.admin.configuration.component.ImportOptionsPanel) IModel(org.apache.wicket.model.IModel) Model(org.apache.wicket.model.Model) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) AjaxFormChoiceComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior)

Example 2 with RadioGroup

use of org.apache.wicket.markup.html.form.RadioGroup in project ocvn by devgateway.

the class GenericBootstrapFormComponent method onInitialize.

/*
     * (non-Javadoc)
     * 
     * @see org.apache.wicket.Component#onConfigure()
     */
@Override
protected void onInitialize() {
    super.onInitialize();
    if ((field instanceof RadioGroup) || (field instanceof CheckGroup)) {
        getAjaxFormChoiceComponentUpdatingBehavior();
    } else {
        getAjaxFormComponentUpdatingBehavior();
    }
    viewModeField = new Label("viewModeField", new ViewModeConverterModel<TYPE>(getModel()));
    viewModeField.setEscapeModelStrings(false);
    viewModeField.setVisibilityAllowed(ComponentUtil.isViewMode());
    border.add(viewModeField);
    tooltipLabel.setConfigWithTrigger(configWithTrigger);
}
Also used : RadioGroup(org.apache.wicket.markup.html.form.RadioGroup) Label(org.apache.wicket.markup.html.basic.Label) TooltipLabel(org.devgateway.toolkit.forms.wicket.components.TooltipLabel) CheckGroup(org.apache.wicket.markup.html.form.CheckGroup) ViewModeConverterModel(org.devgateway.toolkit.forms.models.ViewModeConverterModel)

Example 3 with RadioGroup

use of org.apache.wicket.markup.html.form.RadioGroup in project midpoint by Evolveum.

the class PageNewReport method initLayout.

private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);
    final WebMarkupContainer input = new WebMarkupContainer(ID_INPUT);
    input.setOutputMarkupId(true);
    mainForm.add(input);
    final WebMarkupContainer buttonBar = new WebMarkupContainer(ID_BUTTON_BAR);
    buttonBar.setOutputMarkupId(true);
    mainForm.add(buttonBar);
    final IModel<Integer> groupModel = new Model<Integer>(INPUT_FILE);
    RadioGroup importRadioGroup = new RadioGroup(ID_IMPORT_RADIO_GROUP, groupModel);
    importRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            target.add(input);
            target.add(buttonBar);
        }
    });
    mainForm.add(importRadioGroup);
    Radio fileRadio = new Radio(ID_FILE_RADIO, new Model(INPUT_FILE), importRadioGroup);
    importRadioGroup.add(fileRadio);
    Radio xmlRadio = new Radio(ID_XML_RADIO, new Model(INPUT_XML), importRadioGroup);
    importRadioGroup.add(xmlRadio);
    WebMarkupContainer inputAce = new WebMarkupContainer(ID_INPUT_ACE);
    addVisibileForInputType(inputAce, INPUT_XML, groupModel);
    input.add(inputAce);
    AceEditor aceEditor = new AceEditor(ID_ACE_EDITOR, xmlEditorModel);
    aceEditor.setOutputMarkupId(true);
    inputAce.add(aceEditor);
    WebMarkupContainer inputFileLabel = new WebMarkupContainer(ID_INPUT_FILE_LABEL);
    addVisibileForInputType(inputFileLabel, INPUT_FILE, groupModel);
    input.add(inputFileLabel);
    WebMarkupContainer inputFile = new WebMarkupContainer(ID_INPUT_FILE);
    addVisibileForInputType(inputFile, INPUT_FILE, groupModel);
    input.add(inputFile);
    FileUploadField fileInput = new FileUploadField(ID_FILE_INPUT);
    inputFile.add(fileInput);
    initButtons(buttonBar, groupModel);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) RadioGroup(org.apache.wicket.markup.html.form.RadioGroup) Form(org.apache.wicket.markup.html.form.Form) IModel(org.apache.wicket.model.IModel) Model(org.apache.wicket.model.Model) Radio(org.apache.wicket.markup.html.form.Radio) AceEditor(com.evolveum.midpoint.web.component.AceEditor) AjaxFormChoiceComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) FileUploadField(org.apache.wicket.markup.html.form.upload.FileUploadField)

Aggregations

RadioGroup (org.apache.wicket.markup.html.form.RadioGroup)3 AceEditor (com.evolveum.midpoint.web.component.AceEditor)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 AjaxFormChoiceComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 Form (org.apache.wicket.markup.html.form.Form)2 Radio (org.apache.wicket.markup.html.form.Radio)2 FileUploadField (org.apache.wicket.markup.html.form.upload.FileUploadField)2 IModel (org.apache.wicket.model.IModel)2 Model (org.apache.wicket.model.Model)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 ImportOptionsPanel (com.evolveum.midpoint.web.page.admin.configuration.component.ImportOptionsPanel)1 Label (org.apache.wicket.markup.html.basic.Label)1 CheckGroup (org.apache.wicket.markup.html.form.CheckGroup)1 ViewModeConverterModel (org.devgateway.toolkit.forms.models.ViewModeConverterModel)1 TooltipLabel (org.devgateway.toolkit.forms.wicket.components.TooltipLabel)1