Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: New uitable and 'FocusLostCallback' / 'terminateEditOnFocusLost'
Replies: 2   Last Post: Mar 14, 2013 10:40 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dennis B.

Posts: 14
Registered: 11/17/11
New uitable and 'FocusLostCallback' / 'terminateEditOnFocusLost'
Posted: Mar 13, 2013 8:52 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hey Matlab Community,

Another day, another question to the "new" uitable-version (this is the version without the 'v0' parameter!).

-------------------------------------------------------------------------------------
My Version Info:
-------------------------------------------------------------------------------------
MATLAB Version: 8.0.0.783 (R2012b)
MATLAB License Number: 490269
Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode

-------------------------------------------------------------------------------------
My Problem :
-------------------------------------------------------------------------------------
If I edit a cell inside the new uitable-version and I want to do another gui operation (clicking a button etc.) I must perform the click twice, because the first click only unselects the editable cell.

-------------------------------------------------------------------------------------
I tried the following 2 solutions i found here:
-------------------------------------------------------------------------------------
#1)

jScroll_ja = findjobj(hTable_ja);
jTable_ja = jScroll_ja.getViewport.getView;
jTable_ja.putClientProperty('terminateEditOnFocusLost', java.lang.Boolean.TRUE);

But nothing happens.

#2)

jScroll_ja = findjobj(hTable_ja);
jTable_ja = jScroll_ja.getViewport.getView;
hjTable_ja = handle(jTable_ja,'CallbackProperties');
set(hjTable_ja, 'FocusLostCallback', @gcdcellfocuslost_callback)

with the callback-function:

function gcdcellfocuslost_callback(jtable,eventdata)
component = jtable.getEditorComponent;
if ~isempty(component)
if eventdata.getID == eventdata.FOCUS_LOST,
event = javax.swing.event.ChangeEvent(component);
jtable.editingStopped(event);
end
end
%end function gcdcellfocuslost_callback()

But the callback triggers everytime you select a cell and cancels the selection then. No cell could be selected.

Greetings
D.B.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.