Open epfisztner opened 9 years ago
Ok, so let's have a bindLabel() builder method. (anyway you can still bind it by calling Bindings.bind(Bindings.obs(dropdownLink.getModel()).get(DropdownButtonModel_._text), ...)
I extend the ticket to also support:
The javadocs should also show an example to show how can you create link items dynamically bound to some presenter data (as discussed today with @pkismarczi )
There isn't any field in DropdownButtonModel so this can't be used: Bindings.bind(Bindings.obs(dropdownLink.getModel()).get(DropdownButtonModel_._text), ...)
There's only a protected Link field in the DropdownLink:
protected Link dropdownButton; protected BaseContainer itemContainer;
public DropdownLink(String label) {
super(new DropdownButtonModel());
this.addStyleClass("dropdown");
dropdownButton = new Link(label + " ", "#");
dropdownButton.addStyleClass("dropdown-toggle");
itemContainer = new BaseContainer("ul");
itemContainer.removeStyleClass("container");
itemContainer.addStyleClass("dropdown-menu");
add(dropdownButton);
add(itemContainer);
}
hmm, that's right
It would be great to have chance to change the text of the dropdown by binding.