我在运行时遇到以下异常。 sub fxml是一个Combobox,包含在Main fxml中。目标是使用fx-include标记中的customEvent =“#testSystemSelectAction”连接Combobox选择更改事件以刷新Main中的表
我错过了什么?
非常感谢!
Caused by: com.sun.javafx.fxml.PropertyNotFoundException: Property "customEvent" does not exist or is read-only.
at javafx.fxml.FXMLLoader$Element.processValue(FXMLLoader.java:348)
at javafx.fxml.FXMLLoader$Element.processPropertyAttribute(FXMLLoader.java:325)
at javafx.fxml.FXMLLoader$Element.processInstancePropertyAttributes(FXMLLoader.java:235)
at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:767)
at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2823)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2532)
... 67 more
public class SystemComboboxUIController extends BaseController {
...
private ObjectProperty<EventHandler<ActionEvent>> propertyCustomEvent = new SimpleObjectProperty<EventHandler<ActionEvent>>();
public ObjectProperty<EventHandler<ActionEvent>> customEventProperty() {
return this.propertyCustomEvent;
}
public void setCustomEvent(EventHandler<ActionEvent> customEvent) {
this.customEventProperty().set(customEvent);
}
public EventHandler<ActionEvent> getCustomEvent() {
return this.customEventProperty().get();
}
...
...
<fx:include source="SystemComboboxUI.fxml" fx:id="testSystemComboboxUI" customEvent="#testSystemSelectAction"/>
...
...
@FXML
public void testSystemSelectAction(ActionEvent event) throws Exception {
populateTableview();
}
...