All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ysny.karibu-tools.karibu-tools.0.21.source-code.RadioButtons.kt Maven / Gradle / Ivy

The newest version!
package com.github.mvysny.kaributools

import com.vaadin.flow.component.ItemLabelGenerator
import com.vaadin.flow.component.radiobutton.RadioButtonGroup
import com.vaadin.flow.data.renderer.TextRenderer

/**
 * Sets the item label [generator] that is used to produce the strings shown
 * in the combo box for each item. By default,
 * `String.valueOf()` is used.
 *
 * Setting [RadioButtonGroup.setRenderer] removes any generator set via this function.
 */
public fun  RadioButtonGroup.setItemLabelGenerator(generator: ItemLabelGenerator) {
    // workaround for https://github.com/vaadin/flow-components/issues/1681
    setRenderer(TextRenderer(generator))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy