Java Code Examples for org.apache.wicket.markup.html.form.CheckBox#setOutputMarkupId()

The following examples show how to use org.apache.wicket.markup.html.form.CheckBox#setOutputMarkupId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LayerSelectionPanel.java    From webanno with Apache License 2.0 6 votes vote down vote up
/**
 * Part of <i>forward annotation</i> mode: creates the checkbox to toggle forward annotation
 * mode.
 */
private CheckBox createForwardAnnotationCheckBox()
{
    CheckBox checkbox = new CheckBox("forwardAnnotation");
    checkbox.setOutputMarkupId(true);
    checkbox.add(LambdaBehavior.onConfigure(_this -> {
        // Force-disable forward annotation mode if current layer is not forwardable
        if (!isForwardable()) {
            getModelObject().setForwardAnnotation(false);
        }
    }));
    checkbox.add(new LambdaAjaxFormComponentUpdatingBehavior("change", _target -> 
            owner.getFeatureEditorListPanel().focusForwardAnnotationComponent(_target, true)));
    
    return checkbox;
}
 
Example 2
Source File: AbstractFilterPanel.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
public AbstractFilterPanel(String id, IModel<T> model, String filterId,
                           IModel<V> entityModel,
                           IVisualizer visualizer,
                           IFilterCriteriaManager manager, IModel<Boolean> join) {
    super(id, model);
    this.filterId = filterId;
    this.entityModel = entityModel;
    this.visualizer = visualizer;
    this.joinModel = join;
    this.manager = manager;
    setOutputMarkupPlaceholderTag(true);
    add(new Label("title", getTitle()));
    CheckBox checkBox = new CheckBox("join", join);
    checkBox.add(new AjaxFormSubmitBehavior("change") {});
    checkBox.setOutputMarkupId(true);
    add(checkBox);
    add(new Label("joinTitle", new ResourceModel("widget.document.filter.join"))
            .setOutputMarkupPlaceholderTag(true));
}
 
Example 3
Source File: CheckBoxButton.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @param id
 * @param model
 * @param labelString If null then a classic checkbox is used.
 * @param wantOnSelectionChangedNotifications if true then wantOnSelectionChangedNotifications method returns true.
 * @see CheckBox#wantOnSelectionChangedNotifications()
 */
public CheckBoxButton(final String id, final IModel<Boolean> model, final String labelString,
    final boolean wantOnSelectionChangedNotifications)
{
  super(id);
  this.wantOnSelectionChangedNotifications = wantOnSelectionChangedNotifications;
  checkBox = new CheckBox(WICKET_ID, model) {
    @Override
    public void onSelectionChanged(final Boolean newSelection)
    {
      CheckBoxButton.this.onSelectionChanged(newSelection);
    }

    @Override
    protected boolean wantOnSelectionChangedNotifications()
    {
      return CheckBoxButton.this.wantOnSelectionChangedNotifications();
    }
  };
  checkBox.setOutputMarkupId(true);
  init(labelString);
  labelContainer.add(checkBox);
}
 
Example 4
Source File: CheckBoxPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @param id
 * @param model
 * @param labelString If null then a classic checkbox is used.
 * @param wantOnSelectionChangedNotifications if true then wantOnSelectionChangedNotifications method returns true.
 * @see CheckBox#wantOnSelectionChangedNotifications()
 */
public CheckBoxPanel(final String id, final IModel<Boolean> model, final String labelString,
    final boolean wantOnSelectionChangedNotifications)
{
  super(id);
  this.parentContainer = new WebMarkupContainer("parent");
  add(this.parentContainer);
  this.wantOnSelectionChangedNotifications = wantOnSelectionChangedNotifications;
  checkBox = new CheckBox(WICKET_ID, model) {
    @Override
    public void onSelectionChanged(final Boolean newSelection)
    {
      CheckBoxPanel.this.onSelectionChanged(newSelection);
    }

    @Override
    protected boolean wantOnSelectionChangedNotifications()
    {
      return CheckBoxPanel.this.wantOnSelectionChangedNotifications();
    }
  };
  checkBox.setOutputMarkupId(true);
  this.parentContainer.add(checkBox);
  init(labelString);
}
 
Example 5
Source File: ExternalRecommenderTraitsEditor.java    From inception with Apache License 2.0 5 votes vote down vote up
public ExternalRecommenderTraitsEditor(String aId, IModel<Recommender> aRecommender)
{
    super(aId, aRecommender);
    
    traits = toolFactory.readTraits(aRecommender.getObject());

    Form<ExternalRecommenderTraits> form = new Form<ExternalRecommenderTraits>(MID_FORM,
            CompoundPropertyModel.of(Model.of(traits)))
    {
        private static final long serialVersionUID = -3109239605742291123L;

        @Override
        protected void onSubmit()
        {
            super.onSubmit();
            toolFactory.writeTraits(aRecommender.getObject(), traits);
        }
    };

    TextField<String> remoteUrl = new TextField<>("remoteUrl");
    remoteUrl.setRequired(true);
    remoteUrl.add(new UrlValidator());
    form.add(remoteUrl);

    CheckBox trainable = new CheckBox("trainable");
    trainable.setOutputMarkupId(true);
    trainable.add(new LambdaAjaxFormComponentUpdatingBehavior("change", _target -> 
            _target.add(getTrainingStatesChoice())));
    form.add(trainable);
    
    getTrainingStatesChoice().add(visibleWhen(() -> trainable.getModelObject() == true));
    
    add(form);
}
 
Example 6
Source File: SearchAnnotationSidebar.java    From inception with Apache License 2.0 5 votes vote down vote up
private CheckBox createLowLevelPagingCheckBox()
{
    CheckBox checkbox = new CheckBox("lowLevelPaging");
    checkbox.setOutputMarkupId(true);
    checkbox.add(enabledWhen(() -> searchOptions.getObject().getGroupingLayer() == null
            && searchOptions.getObject().getGroupingFeature() == null));
    checkbox.add(AttributeModifier.append("title",
        new StringResourceModel("lowLevelPagingMouseover", this)));
    return checkbox;
}
 
Example 7
Source File: PermissionPanel.java    From nextreports-server with Apache License 2.0 4 votes vote down vote up
private CheckBox createPermissionCheckBox(String id) {
    CheckBox checkBox = new CheckBox(id);
    checkBox.setOutputMarkupId(true);
    
    return checkBox;
}