My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 316: Set Cell Value Externally
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by Square...@gmail.com, May 16, 2011
I need to programmatically modify cells in a jMesa Worksheet. To be more specific, I need the user to be able to modify "ColumnX" in multiple rows at once by having users select which rows they would like to edit (using the checkbox column) and then systematically setting the value of "ColumnX" in the Worksheet to a new value for each of the selected rows. Is this possible?

I tried to create a custom cell editor on "ColumnX" that will set the cell to the desired value if the checkbox column in the same row is checked in the Worksheet but I cannot find a way to get at the checkbox status in the Worksheet.

I would imagine that the ability to write macros such as this to modify the Worksheet without requiring users to explicitly click on a cell would be very useful in many other instances as well so I am very determined to find a solution.

Thank you for any help you can offer!   

May 17, 2011
Project Member #1 jeff.johnston.mn@gmail.com
Technically you can get at the worksheet in the users session. It is in there keyed by the table id + "_WORKSHEET". From a cell editor you can get at the users session from the WebContext object, which is available if you extend from the AbstractCellEditor. You could also create a SessionWorksheetState object and interact with that to avoid hardcoding the key.

If you want a checkbox that does not link to a column you can create a dummy column (meaning defining a column property that is not part of your java object).

Not sure if that really gets you what you want. What you would really want is spreadsheet-like functionality that lets you highlight a bunch of column rows...but that is beyond the scope of what JMesa does out of the box.

Maybe you could have something like a mass update wizard. Something like select a bunch of rows, and then you go into a modal wizard that lets you select the columns that you want to update, hit next, and then enter values. In that case the checkbox values would not have to be in the worksheet as you could pass the id's right to the modal. You would still create a custom cell editor but just to give you a checkbox and maybe some JavaScript to start up the modal. Then take the values that the user enters and place them in the Worksheet.

May 17, 2011
Project Member #2 jeff.johnston.mn@gmail.com
If you do a modal (popup div) you would still want to refresh the page (table). If you go to another page you could return to the page in the way the user left it by using the State feature.
May 19, 2011
#3 Square...@gmail.com
Thanks Jeff!

I was able to do exactly what I wanted once I was able to get at the worksheet so thank you for the advice and for creating such a great tool!

Powered by Google Project Hosting