Worksheet Editor v3

13 views
Skip to first unread message

Massimiliano Del Matto

unread,
Feb 24, 2012, 9:16:49 AM2/24/12
to JMesa
Hi Jeff and everybody.

I've got a jMesa table where some columns has to be editable (or not)
depending by some business conditions.
As described in some older posts, I created a ProxyWorksheetEditor for
switching between the decorated WorksheetEditor and no
WorksheetEditor. This workaround seems working greatly, except that
you have to use deprecated classes and methods for rendering the table
(i.e. TableFacade instead of TableModel).

I tried working on TableModel, but the major problem I found is that
picking an HtmlColumn's WorksheetEditor, it always gets null...
Also, I didn't found a way of setting the HtmlView object on
TableModel.

Any help would be apreciated, thank you.

Massimiliano Del Matto

Jeff Johnston

unread,
Feb 25, 2012, 1:18:28 PM2/25/12
to jm...@googlegroups.com
You can set the HtmlView on the TableModel.setView() method.

I understand what you are trying to do with proxying the WorksheetEditor. If you look at the HtmlColumn's getEditor() method you can see why that will not work. When the view goes to get the CellEditor the WorksheetEditor will be used (if it is set), or a new one will be created. So you could create a WorksheetEditor and proxy it with your editor and then set that on the column.

Another way that you could do it would be to create a custom HtmlCellRenderer (based off the current one) and then either use your WorksheetEditor or the one that was set on the column.

Let me know if any of those is not quite what you need!

-Jeff Johnston




Massimiliano Del Matto

--
You received this message because you are subscribed to the Google Groups "JMesa" group.
To post to this group, send email to jm...@googlegroups.com.
To unsubscribe from this group, send email to jmesa+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jmesa?hl=en.


Massimiliano Del Matto

unread,
Feb 27, 2012, 5:58:41 AM2/27/12
to JMesa
Hi Jeff.

> You can set the HtmlView on the TableModel.setView() method.
>

Yes, you are right and everything works fine... Maybe last week I was
drunk? :-)
Thank you,

Massimiliano

Jeff Johnston

unread,
Feb 27, 2012, 1:27:09 PM2/27/12
to jm...@googlegroups.com
I am going to see if I can move the (lazy load) creation of the worksheet editor to the getWorksheetEditor() method. Seems logical that you should be able to grab the one that is created and proxy it.

-Jeff



Reply all
Reply to author
Forward
0 new messages