Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining selectProperty methods #57

Closed
matintokyo opened this issue Jan 25, 2022 · 3 comments
Closed

Chaining selectProperty methods #57

matintokyo opened this issue Jan 25, 2022 · 3 comments

Comments

@matintokyo
Copy link

matintokyo commented Jan 25, 2022

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

@matintokyo matintokyo changed the title Chaining selectProperty methods and binding to property with potential intermediate null. Chaining selectProperty methods Jan 25, 2022
@tobiasdiez
Copy link
Owner

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

@matintokyo
Copy link
Author

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

@tobiasdiez
Copy link
Owner

No problems! Closing as duplicate of #10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants