i'm creating a simple project to try gwt, but i'm a real noob :) i've a table in my db, each row in this table has a unique id. i want my application to read this table and display it's contents in a flextable, omitting the column containing the unique id in the db, 'cause the user is not interested in that id. after that, i want the user to click on a row of the flextable and get a detailed view... but i need my unique id to get the detailed data about that row in my db! i'm able to determine in which cell of the flextable the user clicked, so i created a simple widget with开发者_Python百科 a string property and an int property, and i add this widget to the flextable setting the string property to the text from the db i want to display in the flextable and the int property with the db id value... when the user clicks, i get the widget contained in the cell and i can get my id back... but it looks like a very complex solution.
Creating a custom widget is the way to go as soon as your requirements exceed the functionality of the standard widgets provided by GWT.
Note: you may want to reconsider and use Grid instead of FlexTable. Grid seems better in your case since each row contains the same number of cells. See related topic about Grid and FlexTable comparison.
精彩评论