Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
New uitable and 'FocusLostCallback' / 'terminateEditOnFocusLost'
Posted:
Mar 13, 2013 8:52 AM
|
|
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.
|
|
|
|