I'm writing an business application that imports bank statements and allows the user to categorise entries. Once they have done this they can preview their tax statement such as below:
This is currently a gridpane with each cell containing a vbox containing a label and textfield. I don't like it. Its bulky & inflexible.
Each cell is a unique calculation or sum and I'm finding it difficult to get a layout/grouping that I am happy with. I'd like to add descriptive notes adajecent to some cells but this could/would throw the layout out.
I thought about setting specific cells in a tableview like this table:
but seeing this thread How to set value to cell in TableView in javafx and the comment
In JavaFX you generally don't set the values cell by cell like that.
I'm wondering what would be best practice? It seems a bit short sighted that tableviews cannot be used to present (non uniform) non-jpa data.
Update My current work in progress alternative solution is shown in the table above populated by a small class with 3 variables (category, amount and description). Seems better practice.
Related
I'm writing a Notes Client application. Web compatibility is a secondary concern. The language is LotusScript.
The specification: a form to enter lines from receipts. The lines are all saved as part of the same document so that they can be signed as an atomic unit.
When a line is added, it is to be formatted into a table for presentation. Ultimately, this architecture is like an input/datastore/presentation split.
I've managed to get the data stored and signed, and I think I've managed to get it deserializing properly (the LotusScript debugger makes it difficult to see, but it looks right). The problem now is the UI.
Looking at the Programmable Table, it is always a tabbed table with only one row shown per tab. I need a programmable table which can dynamically have rows added to it for display, without forcing new tabs to be created.
This suggests that I would need to use a Rich Text field to contain a table, but thus far my attempts to get anything to display when I try to update a Rich Text field in edit mode have failed. I am forced to conclude that it is impossible.
I cannot figure out how I'm supposed to do a dynamically-displayed list of tabular data like this. Any advice?
Most people just create a table with one row and N columns, with a multi-valued field in each column, and use code to append values to each of the fields in parallel. You don't get borders between rows this way or the ability to do variable formatting of cells, and you have to be careful to avoid letting data length exceed column widths in order to keep everything aligned properly.
If you truly want a dynamic table for presentation with all the bells and whistles that you can get in terms of cell formatting, then the Midas Rich Text API from Genii Software is a commercial solution that can do the job.
I blogged about this a couple of years ago: http://blog.texasswede.com/dynamic-tables-in-classic-notes/
This is a non-XPages solution, but of course you can also use XPages to achieve the same/similar result. It does not use tabs, as each row is a separate table.
Alternatively, you can build your Rich Text Table in another NotesDocument, which you then save. Then use NotesUIDocument.ImportItem (which is undocumented, but present in the R8.5 mail template) to update your NotesUIDocument.
Don't forget to delete the other NotesDocument when you're done.
Another option is to build the table in HTML in computed text, and re-open the document every time you modify it. I have inherited a system that does that, and I hate it...so be warned :)
I have to give a functionality on one of my pages is like:
I have data which represents data of a row from a table, and table has many columns.
This data has to be edited, and sent back to the server.
I am showing data in a datagrid, which obviously doesnt look good as we always have one row and that too a large row, so user has to use scroll to look for some values.
I want suggestions for this, like what should i use to make it look better and more user friendly.
I could have hard coded things but considering, if tomorrow table schema or xml respnse change it will break.
Any suggestions will be nice.
If I have clearly understood your problem, you have too much information in a row and you would like too be able to see all of your row data in the meantime.
How about creating dynamically, on a row double click by example, a form popup that would display vertically your columns data ?
Introduction: I'm using java, oracle, flex, blazeDS etc. The part of the DB that is relevant to the task i am trying to accomplish is illustrated in the image below:
The Task table will also have a field called enabled , which i forgot in the figure below :) This field is used to enable some of the tasks based on various criteria, when an admin user presses a "Generate task list" button in the GUI.
Based on this generation of the task list, the users in the system should see a grid as the one displayed in the figure below :
This task list should display all the enabled task as illustrated above. The first three columns are retrived from the Task table in the DB, while the next columns(Column_4....Column_N) are generated based on the number of users in the User table. These columns should display the users alias. Each user is part of a UserGroup(Group), which i will model in either a separate table or in the User table itself, as illustrated in figure 1. The Numbers in the grid are based on the Time field in the Task_User table, while the first row below the users shows the sum of the times for each user.
Question: Im still learning Flex, and looking for every help i can get on accomplishing my goal :) I figure i have to implement a datagrid with dynamic columns. But how will the dataprovider work in this scenario? For each enabled taskid the grid has to fill the right user columns with time values. Any tips/help would be much appreciated! It is also important that loading this grid doesnt take to long :)
Is it possible to get horizontal and vertical text in the grid(like shown above)?
I am trying to drag and drop hierarchical data in the same advanced data grid, and I would like the data provider to updated when the ADG is updated. (I want to be able to save and load this tree, so it is important that drags and drops are saved.)
I have a sample application (with view source enabled) posted here: www.crcarlson.com/adg/AdvancedDataGridDragAndDrop.swf
The sample app has an ADG showing hierarchical data as well as flat data. The first column of each datagrid shows the rowindex of the underlying data.
If you rearrange the items on the left ADG, the row indexes become unordered. If you click traceTree you see that the data provider is not in order.
On the other hand if you do the same on the right, the row numbers stay ordered even when the objects move around and if you click traceFlat, the data provider is in the order shown on ADG
My goal is to have the data provider order match the ADG order for the left grid which is displaying hierarchical data.
I would appreciate any advice on this, including "you can't get there from here, do it this way."
I noticed a few things while perusing your code and using the app:
Use an ArrayCollection instead of Array as the dataProvider for a view component whose data changes. This might solve your update problems.
If implementing an ArrayCollection doesn't completely solve your update problems, add the necessary logic to a dragDrop or dragComplete event handler.
I get a runtime error every time I drag an item from adg to adgFlat.
Here's Adobe's take on Using Drag and Drop. Specifically check out the last page titled "Moving and copying data". Good luck to you.
We have a Flex DataGrid with 3 columns of which one of them has a custom inline itemrenderer that renders an icon in the cell via an Image component, depending on the data in the row.
The problem is now that sorting this column is incredibly slow. It's OK when we only have a few rows of data in there, but as soon as we have a few hundred or thousand of rows, we notice a freeze of several seconds.
Has anyone noticed this and run into the same problem. If so, did you find any good fix for this? I know we could limit the number of rows in the dataprovider, but I'm really looking for a solution to the root problem.
--
Update: some info on the solution: the problem we had was actually not caused by the item renderer. Since we only have 2 distinct values in that column, it was sorting really slow on large data sets. The solution was to write a custom compare function and append some of the other properties to the value that gets compared to make it more distinct.
I haven't seen this with item renderers but I certainly have seen sort get slow when the data in the column is very similar. For instance in my Census benchmark app the Gender column sorts much slower than the Id column. There is a known bug that has a workaround.
If that is not the problem they you will just need to optimize your item renderer. Check out the code the for default DataGridItemRenderer to see an example of a well optimized renderer.