binding - How to bindBidirectional comboboxes and checkboxes -


i've following class:

    public class model {     ...     private simplestringproperty currency;     public simplestringproperty currencyproperty() {             if(currency == null){                 currency = new simplestringproperty();             }             return currency;         }     ...     } 

and bind (textfield) above class follows:

@fxmlcontroller("view.fxml") public class controller { ... @fxml     private textfield tf_acc_num; @inject     private model model; ... @postconstruct     public void init(){ tf_acc_num.textproperty().bindbidirectional(model.currencyproperty()); ... }} 

it ok. binding comboboxes , checkboxes? assume combobox as

@fxml     private combobox<string> cb_currency; 

and put values in inside init() method

cb_currency.getitems().addall(                 "usd", "eur", "rub"         ); 

does

cb_currency.valueproperty().bindbidirectional(model.currencyproperty()); 

work?


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -