-
Bug
-
Resolution: Unresolved
-
P4
-
8
-
8.0b57
Run the code:
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.util.Callback;
public class JavaApplication4 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
TableView<String> tv = new TableView<>();
TableColumn tc1 = new TableColumn("Strings1");
TableColumn tc2 = new TableColumn("Strings2");
TableColumn nested = new TableColumn("Strings nested");
tv.getColumns().add(nested);
nested.getColumns().addAll(tc1, tc2);
tv.getItems().addAll("One", "Two");
tc1.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<String, String> p) {
return new SimpleStringProperty(p.getValue());
}
});
tc2.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<String, String> p) {
return new SimpleStringProperty(p.getValue());
}
});
tc1.widthProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue ov, Object t, Object t1) {
System.out.println("Called for column 1. New Value : " + t1);
}
});
tc2.widthProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue ov, Object t, Object t1) {
System.out.println("Called for column 2. New Value : " + t1);
}
});
nested.widthProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue ov, Object t, Object t1) {
System.out.println("Called for nested. New Value : " + t1); <- never seen this output.
}
});
vb.getChildren().add(tv);
stage.setScene(new Scene(vb, 300, 300));
stage.show();
}
}
I resize nested column, column1 or column2. But updates on nested column width never comes.
But I saw in internal test application, that sometimes it is updated.
Also, it affects on tests, because it makes troubles for analysing of column headers structure.
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.util.Callback;
public class JavaApplication4 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
TableView<String> tv = new TableView<>();
TableColumn tc1 = new TableColumn("Strings1");
TableColumn tc2 = new TableColumn("Strings2");
TableColumn nested = new TableColumn("Strings nested");
tv.getColumns().add(nested);
nested.getColumns().addAll(tc1, tc2);
tv.getItems().addAll("One", "Two");
tc1.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<String, String> p) {
return new SimpleStringProperty(p.getValue());
}
});
tc2.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<String, String> p) {
return new SimpleStringProperty(p.getValue());
}
});
tc1.widthProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue ov, Object t, Object t1) {
System.out.println("Called for column 1. New Value : " + t1);
}
});
tc2.widthProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue ov, Object t, Object t1) {
System.out.println("Called for column 2. New Value : " + t1);
}
});
nested.widthProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue ov, Object t, Object t1) {
System.out.println("Called for nested. New Value : " + t1); <- never seen this output.
}
});
vb.getChildren().add(tv);
stage.setScene(new Scene(vb, 300, 300));
stage.show();
}
}
I resize nested column, column1 or column2. But updates on nested column width never comes.
But I saw in internal test application, that sometimes it is updated.
Also, it affects on tests, because it makes troubles for analysing of column headers structure.