Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

combotablecell

 
Roger Swillens
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me how i can put a combobox in a tableview in a fxml file.
Is this possible? Maybe a link to a example
I like to work with scenebuilder but there is now option to put a combobox in a column
 
John Damien Smith
Ranch Hand
Posts: 299
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is definitely possible to place ComboBoxes in TableViews.

Please show your effort (code) in trying to solve the problem (maybe an sscce).
That way anybody who wishes to answer can then know what you have tried and where you are having difficulty.

If you have not done so already, please read How to Ask Questions.
 
Roger Swillens
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is not a fxml file but can anybody tel me why i don't see the combobox in tablecolumn c3 when i put a ProgressBarTableCell in it i see it but when i change it to ComboBoxTableCell then column c3 is emty.
By the way Day is a Enum type and returns days of the week.
 
John Damien Smith
Ranch Hand
Posts: 299
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works for me.

I couldn't tell you exactly why it does not work for you.
There are probably many reasons.

For example:

1. The value you pass to PropertyValueFactory should follow java naming conventions (e.g. start with a lowercase).
2. You may not have defined the matching property in your model class for the table view.
3. You might not have set the table and the table column of the combo selectable value to editable.
4. You might not be double clicking a cell to put it into editing mode so that the corresponding combo box displays.
5. . . .



One thing to note with the above code is that when you run it on Java8u20b11, it outputs CSS warnings (which it should not do). It otherwise seems to work OK after some limited testing. I created https://javafx-jira.kenai.com/browse/RT-36966 to request a developer look into why the css warnings are being generated.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic