(function() { var template = Handlebars.template, templates = OC.Settings.Templates = OC.Settings.Templates || {}; templates['federationscopemenu'] = template({"1":function(container,depth0,helpers,partials,data) { var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined }; return ((stack1 = lookupProperty(helpers,"unless").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"unless","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":2},"end":{"line":25,"column":13}}})) != null ? stack1 : ""); },"2":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined }; return "
  • \n" + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"disabled") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(6, data, 0),"data":data,"loc":{"start":{"line":5,"column":3},"end":{"line":9,"column":10}}})) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"iconClass") : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(10, data, 0),"data":data,"loc":{"start":{"line":10,"column":4},"end":{"line":14,"column":11}}})) != null ? stack1 : "") + "

    \n " + alias4(((helper = (helper = lookupProperty(helpers,"displayName") || (depth0 != null ? lookupProperty(depth0,"displayName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data,"loc":{"start":{"line":16,"column":35},"end":{"line":16,"column":50}}}) : helper))) + "
    \n " + alias4(((helper = (helper = lookupProperty(helpers,"tooltip") || (depth0 != null ? lookupProperty(depth0,"tooltip") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tooltip","hash":{},"data":data,"loc":{"start":{"line":17,"column":40},"end":{"line":17,"column":51}}}) : helper))) + "\n

    \n" + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"disabled") : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.program(14, data, 0),"data":data,"loc":{"start":{"line":19,"column":3},"end":{"line":23,"column":10}}})) != null ? stack1 : "") + "
  • \n"; },"3":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined }; return "
    \n"; },"4":function(container,depth0,helpers,partials,data) { return "active"; },"6":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined }; return " \n"; },"8":function(container,depth0,helpers,partials,data) { var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined }; return " \n"; },"10":function(container,depth0,helpers,partials,data) { return " \n"; },"12":function(container,depth0,helpers,partials,data) { return "
    \n"; },"14":function(container,depth0,helpers,partials,data) { return " \n"; },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined }; return "\n"; },"useData":true}); })();docs-link-syntax&id=d65325e326f40e6e9abd3b7f62493e3314e788b5'>root/documentation/components/components-checkbox.asciidoc
    blob: 4e1205be8f71fd4a97672090b025e9fdb37fb90c (plain)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    
    ---
    title: CheckBox
    order: 15
    layout: page
    ---
    
    [[components.checkbox]]
    = CheckBox
    
    ifdef::web[]
    [.sampler]
    image:{live-demo-image}[alt="Live Demo", link="http://demo.vaadin.com/sampler/#ui/data-input/other/check-box"]
    endif::web[]
    
    [classname]#CheckBox# is a two-state selection component that can be either
    checked or unchecked. The caption of the check box will be placed right of the
    actual check box. Vaadin provides two ways to create check boxes: individual
    check boxes with the [classname]#CheckBox# component described in this section
    and check box groups with the [classname]#CheckBoxGroup# component, as described in
    <<dummy/../../../framework/components/components-optiongroups#components.optiongroups,"CheckBoxGroup and RadioButtonGroup">>.
    
    Clicking on a check box will change its state. The state is a [classname]#Boolean#
    property that you can set with the [methodname]#setValue()# method and obtain with
    the [methodname]#getValue()# method. Changing the value of a check box will cause
    a [classname]#ValueChangeEvent#, which can be handled by a [classname]#ValueChangeListener#.
    
    
    [source, java]
    ----
    CheckBox checkbox1 = new CheckBox("Box with no Check");
    CheckBox checkbox2 = new CheckBox("Box with a Check");
    
    checkbox2.setValue(true);
    
    checkbox1.addValueChangeListener(event ->
        checkbox2.setValue(! checkbox1.getValue()));
    ----
    
    The result is shown in <<figure.components.checkbox.basic>>.
    
    [[figure.components.checkbox.basic]]
    .An Example of a Check Box
    image::img/checkbox-example1.png[width=35%, scaledwidth=50%]
    
    
    == CSS Style Rules
    
    
    [source, css]
    ----
    .v-checkbox { }
      .v-checkbox > input { }
      .v-checkbox > label { }
    ----
    
    The top-level element of a [classname]#CheckBox# has the
    [literal]#++v-checkbox++# style. It contains two sub-elements: the actual check
    box [literal]#++input++# element and the [literal]#++label++# element. If you
    want to have the label on the left, you can change the positions with "[literal]#++direction: rtl++#" for the top element.