From: Anton Kotelyanskii on
I'm wondering if there's a way to change data in multiple cells without having to reload the whole table?

I currently have a table with one column as checkboxes, and certain rows are used to represent a group of other rows. I currently have it so that if one of these "group" checkboxes is pressed, it changes the data for the table in those cells, then i use the set command to load the new data. This can be cumbersome and slow, so I am wondering if I can have the checkboxes changed without having to reload the whole data.

My current idea is to find a way to specifically refrence those cells, but I can't find a way to do that. I have found a way on the forums in which you go through the Java handle, but that doesn't work with 2010a.

Thanks
From: Walter Roberson on
Anton Kotelyanskii wrote:
> I'm wondering if there's a way to change data in multiple cells without
> having to reload the whole table?

http://www.mathworks.com/matlabcentral/newsreader/view_thread/281187
From: Anton Kotelyanskii on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hutuav$lim$1(a)canopus.cc.umanitoba.ca>...
> Anton Kotelyanskii wrote:
> > I'm wondering if there's a way to change data in multiple cells without
> > having to reload the whole table?
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/281187
This is the method that I found using Java handles that doesn't work with 2010a.
jtable = mtable.getTable; results in the error message: "??? Attempt to reference field of non-structure array."
From: Yair Altman on
"Anton Kotelyanskii" <akotelyanskiI(a)yahoo.com> wrote in message <hv0asb$k75$1(a)fred.mathworks.com>...
> Walter Roberson <roberson(a)hushmail.com> wrote in message <hutuav$lim$1(a)canopus.cc.umanitoba.ca>...
> > Anton Kotelyanskii wrote:
> > > I'm wondering if there's a way to change data in multiple cells without
> > > having to reload the whole table?
> >
> > http://www.mathworks.com/matlabcentral/newsreader/view_thread/281187
> This is the method that I found using Java handles that doesn't work with 2010a.
> jtable = mtable.getTable; results in the error message: "??? Attempt to reference field of non-structure array."

In your case, you are probably using the new (R2008a+, supported) version of uitable, rather than the old (pre-R2008a, unsupported) version. Unfortunately, unlike the unsupported version, the new version does not directly expose its Java handle. However, you can use the FindJObj utility on the File Exchange ( http://www.mathworks.com/matlabcentral/fileexchange/14317-findjobj ) to get this reference:

mtable = uitable(...);
jscroll = findjobj(mtable);
jtable = jscroll.getViewport.getComponent(0);

Note that the new uitable version extends com.jidesoft.grid.SortableTable, which provides the ability to group rows - something that could be most useful from your description of your problem. Obviously this functionality is only accessible via Java.

Yair Altman
http://UndocumentedMatlab.com