[英]In TornadoFX, how can I bind BigDecimal properites to another BigDecimal property using objectBinding?
[英]In TornadoFX, how can I select a deeply-nested property on an nullable property of an ItemViewModel?
TornadoFX具有一个select
函数,该函数用于访问属性内的属性。 例如,用法为:
textfield(viewModel.customerProperty.select(Customer::nameProperty))
而且,这很好用,但是如果customerProperty
的值可以为null( Customer?
),则select
不起作用,因为它希望非null对象从中进行“选择”。
如果该Property
具有nullable
值,如何在其上使用select
?
即使属性可以包含null,也不需要将类型声明为可为null。 只需更改属性的类型,就可以了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.