1
私には2つの問題があります。私はListView
とcrudを作成しようとしています。 Now here's how I want my UI to look。JavaFX 1.3:ListViewを使ったCRUD
私は、次のコードでこれを作成しました:今ここ
var studentManagementListView: ListView = ListView {
items: ["bla", "bla", "bla", "bla", "bla", "bla", "bla", "bla", "bla", "bla", "bla"]
cellFactory: function() {
def listCell: ListCell = ListCell {
node: HBox {
spacing: 10
content: [
Label {
text: bind if (listCell.empty) then "" else "{listCell.item}"
visible: bind not listCell.selected and not listCell.empty
}
TextBox {
text: bind listCell.item.toString()
columns: 12
visible: bind listCell.selected and not listCell.empty
selectOnFocus: true
}
SwingComboBox {
visible: bind listCell.selected and not listCell.empty
items: for (classItem in classes) {
SwingComboBoxItem {
selected: false
text: classItem.toString()
value: classItem
}
}
}
Button {
text: "delete"
visible: bind listCell.selected and not listCell.empty
action: function() {
}
}
Button {
text: "save"
visible: bind listCell.selected and not listCell.empty
action: function() {
}
}
]
}
}
}
};
私がいるトラブルがあります。
SwingComboBox
は非常に奇妙な行動しているListCell
が新鮮に選択されている場合、それだけで開きます。SwingComboBoxItem
を選択することも不可能です。- 保存ボタンのアクション内で「テキスト」変数にアクセスするにはどうすればよいですか? (選択された
ComboBox
のような)他の変数はありますか?私はListView
の外でListCellを定義しようとしましたが、一般的にはListView
の外にあるものをすべて定義するので、すべてを簡単に使うことができますが、いくつかのことがすでに定義されているというエラーがあります。
基本的に2番目の問題については、ListView
を別の方法で入力する方法を知りたいと思っています。
私は実際にGoogleマシンで何も使用されていません。誰かが助けてくれたら、私はそれを感謝します!