tobiasdiez/EasyBind

Chaining selectProperty methods

matintokyo opened this issue · 3 comments

Hi, thank you for your great work on EasyBind.

I come from using Tomas Mikula's EasyBind and would like to know how to achieve selectProperty chaining using your latest release (2.20 as of time of writing).

Using Tomas Mikula's version I would write for example the following code:

textField.textProperty().bind(
                    org.fxmisc.easybind.EasyBind.monadic(itemProperty())
                            .selectProperty(Item::thingProperty)
                            .selectProperty(Thing::stringProperty));

Using your implementation, I cannot chain selectionProperty methods. Would the following be the correct equivalent?

textField.textProperty().bind(
                   EasyBind.wrapNullable(
                           EasyBind.select(itemProperty())
                                   .selectObject(Item::thingProperty)
                   ).selectProperty(Thing::stringProperty));

Thank you for you help!

Matthis

This is currently not easily possible. If I understand you correctly, then this is a duplicate of #10, right?

You are right… sorry I had not read #10 before posting…!

No problems! Closing as duplicate of #10.