java - new PropertyValueFactory<, >() for a collection -
my problem want use collection type new propertyvaluefactory<,>()
tablecolumn columnname = new tablecolumn("nom"); columnname.setcellvaluefactory(new propertyvaluefactory<notebean, list>("name"));
because notebean contains field of type collection (list).
thank ;).
the solution problems parse collection for
or while
using code :
tablecolumn<person,string> firstnamecol = new tablecolumn<person,string>("first name"); firstnamecol.setcellvaluefactory(new callback<celldatafeatures<person, string>, observablevalue<string>>() { public observablevalue<string> call(celldatafeatures<person, string> p) { return p.getvalue().firstnameproperty(); } }); }
for exemple :
tablecolumn columnmod = new tablecolumn<modulenotebean, double>( mobean.getmodulebean()); (int = 0; < mobean.getlistmat().size(); i++) { tablecolumn columnnote = new tablecolumn(mobean.getlist_mat() .get(i)); final int index = i; columnnote .setcellvaluefactory(new callback<celldatafeatures<modulenotebean, string>, observablevalue<string>>() { public observablevalue<string> call( celldatafeatures<modulenotebean, string> p) { simplestringproperty b = new simplestringproperty(p .getvalue().getmodulenlist().get(0) .getnotelist().get(index) + ""); return b; } });
Comments
Post a Comment