0

I populate Employees pojo in TableView colums.
Employer contains rate property, that contains doubleDomainObject which not populate in tableView. Implementation of comboBox i not showing because it good working with CellFactory. It is desirable to focus with CellValueFactory.

DoubleDomainObject

public class DoubleDomainObject extends DomainObject {
private SimpleObjectProperty<Double> doubleValue =new SimpleObjectProperty(this, "doubleValue", null);

public Double getDoubleValue() {return doubleValue.get(); }
public SimpleObjectProperty<Double> doubleValueProperty() {return doubleValue;}
public void setDoubleValue(Double value) {this.doubleValue.set(value);}
}

ColumnDoubleComboBox

public class ColumnDoubleComboBox extends ColumnWrapper{
  protected TableColumn<DomainObject, DoubleDomainObject> column;

  @SuppressWarnings("unchecked")
  public ColumnDoubleComboBox(Bulder builder) {
      super(builder);
      this.column =  new TableColumn<>(columnName);
      setCellValueFactory();
     setCellFactory();
    }

  public void setCellValueFactory(){
      column.setCellValueFactory(new PropertyValueFactory<>(propertyName));
    }
}

Employees

public class Employees extends DomainObject {

private SimpleObjectProperty<DoubleDomainObject> rate =new 
    SimpleObjectProperty<>(this, "rate", null);


public DoubleDomainObject getRate() {
   return rate.get();
}

public SimpleObjectProperty<DoubleDomainObject> rateProperty() {
   return rate;
}

public void setRate(RatePerHour rate) {
    this.rate.set(rate);
}
}

---Сlient code---

tableViewWrapper = AppNode.NodeBuilder.create()
        .<Employees>createTableViewWrapper()
        .setDataMapper(this.dataMapperFabric.getEmployeesDataMapper())
        .setColums(
columnFabric.createColumnDoubleComboBox(ColumnWrapper.Bulder.create()              
.setColumnName("RATE").setColumnSize(0.2).setPropertyName("rate")
                       .............................etc
        );
3
  • 1
    Can you create an example that doesn't rely on the proprietary infrastructure code (builders, etc) that you have? It's pretty much impossible to diagnose this, or create an answer that would be useful for anyone else, from the code you've posted. Assuming the objects in the table's items list have a rateProperty() method, this should give you something (though it might not give it to you formatted the way you want). Commented Apr 8, 2018 at 20:18
  • Maybe see stackoverflow.com/questions/46309376/… Commented Apr 8, 2018 at 22:52
  • Thanks for your answer. Commented May 26, 2018 at 15:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.