How to fire "table change" once click other regions outside the table erea?

I have a JTable created with DefaultTableModel. Usually the edit behavior of table cell is like this:
1) Select one cell, it is highlighted in blue.
2) Double click the cell, it's made editable with white background.
3) Two scenarios
(a) Once finish edit, press "Enter", the cell background turns from white to blue. At the same time, the table change is "fired" .
(b) Once finish edit, click another cell, the originall cell turns white, and the new-clicked cell is highlighted in blue. At the same time, the table change is "fired".
4) While editing one cell, and click somewhere OUTSIDE the table area. In this case, the table change is NOT fired.
[This cause a confusion, user sees the changed text in table cell, but actually it is not stored and will not be stored in the table.]
So what I want to implement is: once click the region outside the table, the text in that editabe cell (where you are just editing) is stored and fired.
Can you help me? Thanks in advance!

sabre150 & other experts,
[see background in my first message]
User is still not completely satisfied with the current behavior, though "table changed" can be fired when clicking other controls(eg. buttons or checkboxes).
If I click a panel region(instead of a particular control), the "table changed" can not be fired. However, it is expected.
I guess the reason is:
a panel doesn't has a focus. so when clicking panel, the focus is not "lost" to the table cell.
Any hints?

Similar Messages

  • How to update JTable when clicking outside the table?

    Hi
    (Sorry if this has been asked before but I can't seem to see exactly how to do this from previous posts.)
    I have a JTable which sits on a jPanel which itself is part of a frame.
    When I click anywhere outside the table when I'm editing a cell in the table, how do I end the edit mode of the table (so that the cell is updated with the new contents).Currently I can only update a cell's contents during edit when hitting 'enter' or by clicking on another cell within the table.
    It seems that the following code is used in the process but I'm sure that I'm still missing something:
    if(table1.getCellEditor()!=null)
    table1.getCellEditor().stopCellEditing();
    If anyone out there knows how to do this,I'd really appreciate hearing how.
    Thanks a lot
    LGS

    Thanks for your comments but I'm still having problems.
    When I add the following code:
    table1.addFocusListener(new java.awt.event.FocusAdapter()
    public void focusLost(java.awt.event.FocusEvent evt)
    if (table1.getCellEditor() != null)
    table1.getCellEditor().stopCellEditing();
    and then try to edit my table,as soon as I double click on any cell in the table,my setValueAt method in my Table Model is being called before I even edit the cells contents. The above code is in the same method in which I actaully create table1 i.e.createTable().
    Can anyone help?

  • How do I use the value of a table attribute outside the table?

    I have two tables that are master detail. But it might not be so obvious to the user before he knows how the page works that they are master detail. The tables are in separate showDetailItems in a panelAccordion and what I was thinking of was to show the value of one coloum in the selected row in the master in the text in the showdetail item that contains the detail table. But I can´t find the right expression to put into the accordion. How should the expression look like to get the value of an attribute in a table for use outside the table?

    Thanks for the suggestion but it doesn´t work. The first problem is that the page turns blank when I use that expression for the text in the showDetailItem and the second problem is that I don´t seem to be able to use the master table as a partial trigger. When I click edit in the partial trigger property I can´t shuttle the master table over to be a partial trigger to the showDetailItem even if the table has an id.
    Edited by: Atlantic Viking on Apr 2, 2009 6:24 AM
    Well I figured out how to come half way. I did the following things:
    1) Created an attribute value binding to the attribute I wanted to be shown in the showDetailItem
    2) Set the text property in the showDetailItem to this attribute value like this #{binding.attributeValue}
    To solve the problem I had with the partial triggers I continued like this
    3) Gave other components on the path from the showDetailItem to the master table id´s
    4) Clicked edit on the partial trigger property on the showDetailItem and was now able to shuttle the master table over to be a partial trigger.
    But I now got an other problem which looks like a bug. At first when I enter the page it looks fine but when I change focus in the master table to another row part of the showDetailItem containing the detail table disapears. The detail table still remains and works as it should but the part containing the text I tried to set above disapears and the text in the showDetailItem containing the master gets replaced by the text that was supposed to be in the showDetailItem containing the detail table. Any suggestions how to correct this are very welcome.
    Edited by: Atlantic Viking on Apr 2, 2009 6:59 AM

  • How can I add/change art work to albums where the art work isn't available at iTunes?

    How can I add/change art work to albums where the art work isn't available at iTunes?

    Go to google and search for the artwork.  When you find it, save it to your computer.  Right click the album and select get info.  Drag the image you saved to the empty box for album art.

  • How do you save changes made in iPhoto, and export the changed file.  It keeps reverting back to the original.

    How do you save changes made in iPhote, and export the changed picture file? When I select export, current format, it reverts to the original, wiping out all my work.

    Try trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder.
    (On 10.7 or later: Hold the option (or alt) key while clicking on the Go menu in Finder to access the User Library)
    (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    What's the plist file?
    For new users: Every application on your Mac has an accompanying plist file. It records certain User choices. For instance, in your favourite Word Processor it remembers your choice of Default Font, on your Web Browser is remembers things like your choice of Home Page. It even recalls what windows you had open last if your app allows you to pick up from where you left off last. The iPhoto plist file remembers things like the location of the Library, your choice of background colour, whether you are running a Referenced or Managed Library, what preferences you have for autosplitting events and so on. Trashing the plist file forces the app to generate a new one on the next launch, and this restores things to the Factory Defaults. Hence, if you've changed any of these things you'll need to reset them. If you haven't, then no bother. Trashing the plist file is Mac troubleshooting 101.

  • I live in Australia but when I upgraded to IOS6 it changed my App Store region to the US. How can I change it back? I have been trying to find the answer.

    I live in Australia but when I upgraded to IOS6 it changed my App Store region to the US. How can I change it back? I have been trying to find the answer.

    Contact iTunes support & request they clear the balance:
    http://www.apple.com/support/itunes/

  • How can I take check box in particular cell of the table in smartforms??

    Hi experts,
       pls tell me how can I take check box in particular cell of the table in smartforms??
    It is not interactive form.
    I hv taken small windows as check boxes.but i think it is not a proper solution....give me another solution...

    Hi,
    first create text for a particular cell.
    In that we have a  text editor  in that text editor we have symbols in include menu.
    whatever the symboll u want to put to ur cell . just assign it.
    please check it. if it helpful reward points.
    regards,
    satish.

  • HOW WE CAN DO TRIAL AND ERROR METHOD TO FIND THE TABLES AND FIELDS?

    HOW WE CAN DO TRIAL AND ERROR METHOD TO FIND THE TABLES AND FIELDS FOR ENHANCING THE AUTOMATIC SERIAL NUMBER PROFILE///

    Hi
    You can find user-exit for that. In user exit function you can use all import parameter. Set debugging in include program and you can see all import parameter.
    Regards,
    M Sajid

  • When I try to activate my cs 3 premium production, I get a message saying NO CONNECTION. Everything is in order though. How can I get an activatioon number other then trough the web??

    When I try to activate my cs 3 premium production, I get a message saying NO CONNECTION. Everything is in order though. How can I get an activatioon number other then trough the web??

    Sign in, activation, or connection errors | CS5.5 and later, Acrobat DC

  • How can I add a fade or other transitions to the pages of my website?

    How can I add a fade or other transitions to the pages of my website?

    like this :
    http://www.onextrapixel.com/2010/02/23/how-to-use-jquery-to-make-slick-page-transitions/
    Cheer up !

  • How do I transfer my photos and other items from the cloude to my Dell desktop

    How do I transfer my photos and other items from the cloud to my Dell
    desktop

    Hello johnfromwildomar,
    Thank you for using Apple Support Communities.
    You can use the following articles to help you set up to share photos from iCloud to your computer.
    iCloud: Set up My Photo Stream
    iCloud" My Photo Stream FAQ
    Regards,
    Jeff D. 

  • How to make new column in table changing depending on other columns

    hi
    i have table and i want to add new column that calculate the deference between two other columns.
    i create the column and i could loop in the content of the table but i could not update the entries in the new columns.
    regards
    Said

    Hi!
    did u try creating a node for the same? create a value node for the table with 3 value attrbutes, one for each column. then in the init method of that view, just create 3 arrays, setting the value in the first two array. then make use of this code for setting the difference in the thrid column
    IPrivateUIView.I<valuenode> tab_node = wdContext.node<valuenode>();
    for(int i= 0; i<6;i++)
         IPrivate<view>.I<valueelement> num_ele = tab_node.create<valueelement>();
         num_ele.set<valueattribute1>(num1<i>);
         num_ele.set<valueattribute2>(num2<i>);
         num_ele.set<diffvalueattribute>(num1<i>-num2<i>);
         wdContext.node<valuenode>().addElement(num_ele);
    this will surely work .
    Do let me know the results.

  • BUTTON CLICK ON SEARCH ITEM CAUSES OTHER REGIONS (FORM) IN TABLE TO ERRORS

    Hello,
    I dont know if I have come to a limitation or flaw of the XE or is it me who does not know how to. (probably me)
    The thing is that I have in one page, one standard form for entering data and one report output table to show them. This output table has incorporated that built-in feature of Search
    Now, what happens, if I click on the search button to locate a record in the Report table, as the full page reloads, then the Form region also loads but as it has no data, in the effect of being reloaded activates its button of submit, bringing my report table to all errors as it is getting null values which are not allowed. I really need the search feature because otherwise users can have the more and more unconfortable time to locate things as the table grows to thousands of rows.
    any help would be greatly appreciated
    kindest regards
    Alvaro

    Hi,
    My first option probably do not even work. I did mean put expression "GO" as I understand go button submit request GO.
    And now when I think it is validations that gives those errors. Right ?
    So you need set that condition "PL/SQL function body returning a Boolean" to after submit validations
    RETURN :REQUEST IN('SAVE','CREATE');Sorry, about confusion
    Automatic Row Processing (DML) process that actually insert/update/delete is anyway run only when certain submit requests
    >
    Valid Update Request Values: SAVE, APPLY CHANGES, UPDATE, UPDATE ROW, CHANGE, APPLY, APPLY%CHANGES%, GET_NEXT%, GET_PREV%
    Valid Insert Request Values:      INSERT, CREATE, CREATE_AGAIN, CREATEAGAIN
    Valid Delete Request Values: DELETE, REMOVE, DELETE ROW, DROP
    >
    Br, Jari

  • How to maintain payment term descriptioin in other languages in TVZBT table

    Hi all,
    i have to maintain the payment terms in different language.
    For that, i am updating the table TVZBT by using TCODE SE63 in development sys.
    it has not asked any change request.but table is updated . so i can not move the changes to production.
    please tell me is there any other solution or directly same way update the table in production

    If you are using version 4.6C there are settings to be made within SE63 in the menu Goto -> Administration -> transport settings.
    Check to see the Recd method field to see if the option says 'No recording'.
    If it is ok, then you can see the transport request in the Requests menu from this screen.
    Thanks
    Seshu

  • How can I restrict more then one user to access the table?

    Hi !
    I have a problem and two solutions and I am a bit confused as to
    which one is the best one and/or can there be any better way of
    handling the problem ?
    Problem : I have to update a key field of a table when I update
    it in the form 5.0 screen. I am basically doing a maintenance of
    a table and if a certain field is updated then the change has to
    be reflected in two more tables. But the issue is that the field
    is a part of the key in those two tables. So all I can think of
    is that I need to insert new set or rows for that new value of
    the field and delete the old set of records for old values of
    the field.
    There are two ways of doing it;
    1.One option can be to explicitely define two cursors separately
    and fetch the values in them one by one and then insert the new
    records and then delete the old records in both the tables. This
    I feel will be a cumbersome process both in terms of processing
    time and the coding.
    2.Second option I was thinking can be to create two flat tables
    (without keys) and insert the values in them and update the
    changed field there and then insert the rows in the respective
    tables. Delete the old records in the main tables and delets the
    records in these flat tables. This is a bit more faster and
    easier to predict and code. This seems to be a better option for
    me.
    Any comments on these ?
    In both the cases I was thinking of making some provision so
    that more then one person can't update the table simultaneously.
    Since if there are more then one persons doing the processing
    then some inconsistency might creep into the whole process.
    This is easier to do in the second process as if I check the
    data in the flat tables and if there is some data then I can
    presume that some one is doing the processing and I can ask the
    other person to hold for a while. But in this case how can I
    stop more then two people to simultaneously check for the empty
    table and start inserting the record ?
    I was just thinking of having a sepatare table having only one
    field and this will be a key field and as the process begins the
    process will insert a fix value say 'Y' in the key field and at
    the end of the process the record will be deleted and this way
    we can restrict the user to access the process more then one at
    a time..? Since you can't have same value of the key in a table
    more then once.
    Any better way of handling it will be deeply appreciated.
    How about locking the table at the begining and releasing the
    lock at the end ? Will there be any issue in that? since I am
    inserting and deleting the rows in the same transaction.
    Comments welcome,
    Shobhit
    null

    How about performing the update IN the database using a stored
    procedure?
    By using non-database fields on your form to get the
    information, you can then call the procedure in the database to
    perform the updates. If an error occurs in the procedure you
    rollback, if necessary, and send a message or status back to the
    form. If it succeeds you might wish to commit and then re-
    execute the form's query -- using either the original key values
    or the new key values...
    null

Maybe you are looking for

  • How can i update/Remove Items from AR Invoice using SDK?

    Hi All, I have 1 problem with update or remove item from sales order. here is the source code of mine. If inv.GetByKey(DocumentNumber) = True Then                     inv.CardCode = cardcode                     Dim ercode As Integer                  

  • Events in ABAP Programming

    Hi, Can anybody please list out the exact differences between the events 'LOAD-OF-PROGRAM', 'INITIALIZATION' and 'AT SELECTION-SCREEN OUTPUT'. Thanks in advance, Sujit.

  • Multiple account assignment PO with Asset

    Hi all I am making an Asset PO with quantity 5 and with multiple account assignment selection  & distribution on qty basis with different Asset No. for each In this PO the octroi charges are maintained. during the MIRO simulation the delivery cost is

  • Primary Key from Database Sequence

    Hi, I have a form that has a master block(single_record) and a child block(multi-record). I am using Database Sequence for primary key. And I am not using any toolbar, instead using the default from FORMS. I want to keep this primary key field invisi

  • Anyone else have sharp edges on ipad mini?

    I just got my mini last week.  I am wondering why its not feeling right in my hands.  The edges where the glass meets the case feel a little sharp.  Like the aluminum wasn't deburred or the glass isnt sitting properly.  Anyone else noticing sharpish