carlw
04/12/2017, 5:53 PMron
04/12/2017, 7:15 PMedvin
04/12/2017, 7:20 PMron
04/12/2017, 7:20 PMron
04/12/2017, 7:20 PMron
04/12/2017, 7:20 PMron
04/12/2017, 7:21 PMron
04/12/2017, 7:21 PMedvin
04/12/2017, 8:10 PMnimakro
04/12/2017, 8:12 PMfind<HeaderFragment>(mapOf(HeaderFragment::todoItem to item))
but it is not working,
I get the following error Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
, do I miss something?edvin
04/12/2017, 8:13 PMHeaderFragment::todoItem
?edvin
04/12/2017, 8:13 PMfind<HeaderFragment>(mapOf("todoItem" to item))
to rule out type issues.nimakro
04/12/2017, 8:17 PMError:(25, 17) Kotlin: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
@InlineOnly public inline fun <T> Array<out HeaderFragment>.find(predicate: (HeaderFragment) -> Boolean): HeaderFragment? defined in kotlin.collections
@InlineOnly public inline fun BooleanArray.find(predicate: (Boolean) -> Boolean): Boolean? defined in kotlin.collections
@InlineOnly public inline fun ByteArray.find(predicate: (Byte) -> Boolean): Byte? defined in kotlin.collections
@InlineOnly public inline fun CharArray.find(predicate: (Char) -> Boolean): Char? defined in kotlin.collections
@InlineOnly public inline fun CharSequence.find(predicate: (Char) -> Boolean): Char? defined in kotlin.text
@InlineOnly public inline fun DoubleArray.find(predicate: (Double) -> Boolean): Double? defined in kotlin.collections
@InlineOnly public inline fun FloatArray.find(predicate: (Float) -> Boolean): Float? defined in kotlin.collections
@InlineOnly public inline fun IntArray.find(predicate: (Int) -> Boolean): Int? defined in kotlin.collections
@InlineOnly public inline fun LongArray.find(predicate: (Long) -> Boolean): Long? defined in kotlin.collections
@InlineOnly public inline fun ShortArray.find(predicate: (Short) -> Boolean): Short? defined in kotlin.collections
@InlineOnly public inline fun <T> Iterable<HeaderFragment>.find(predicate: (HeaderFragment) -> Boolean): HeaderFragment? defined in kotlin.collections
@InlineOnly public inline fun <T> Sequence<HeaderFragment>.find(predicate: (HeaderFragment) -> Boolean): HeaderFragment? defined in kotlin.sequences
And this is the code:
class ToDoTreeCell: TreeCell<TodoItem>() {
override fun updateItem(item: TodoItem?, empty: Boolean) {
super.updateItem(item, empty)
text = null;
if (empty || item == null) {
graphic = null;
} else {
// TODO: We need to also check if the date is not overdue
if (treeItem.isPreviousSiblingDifferentDate()) {
//graphic =
find<HeaderFragment>(mapOf(HeaderFragment::todoItem to item!!))
} else {
//graphic =
}
}
}
override fun updateSelected(selected: Boolean) {
super.updateSelected(selected)
}
}
private fun TreeItem<TodoItem>.isPreviousSiblingDifferentDate(): Boolean {
return false
}
public class HeaderFragment: Fragment() {
val todoItem: TodoItem by param()
override val root = vbox {
}
}
edvin
04/12/2017, 8:19 PMComponent
, and you try to use it inside a TreeCell
.nimakro
04/12/2017, 8:20 PMedvin
04/12/2017, 8:20 PMFX.find
🙂edvin
04/12/2017, 8:20 PMComponent
tomorrow 🙂 I'll relax for the rest of the evening 🙂nimakro
04/12/2017, 8:22 PMnimakro
04/12/2017, 8:22 PMedvin
04/12/2017, 8:25 PMmikehearn
04/13/2017, 12:05 PMmikehearn
04/13/2017, 12:05 PMmikehearn
04/13/2017, 12:05 PMmikehearn
04/13/2017, 12:07 PMmikehearn
04/13/2017, 12:07 PMmikehearn
04/13/2017, 12:08 PMmikehearn
04/13/2017, 12:08 PMfieldset("Configuration") {
isFillWidth = true
hbox {
vbox {
field("Node Name", op = { nodeNameField() })
field("Nearest City", op = { nearestCityField() })
field("P2P Port", op = { p2pPortField() })
}
vbox {
field("RPC port", op = { rpcPortField() })
field("Web Port", op = { webPortField() })
field("Database Port", op = { databasePortField() })
}
}
}
nimakro
04/13/2017, 12:41 PMYou could do this:▾
nimakro
04/13/2017, 12:41 PMclass TestFragment: Fragment() {
override val root = form {
fieldset("Configuration:") {
field("Field1/Field2:") {
textfield()
textfield()
}
}
}
}
nimakro
04/13/2017, 12:43 PM