Problem updating table Cell display

Hi, any ideas about this problem would be very much appreciated Ive had it for 6 months but have been unable to get to the bottom of it.
I have an application which contains a JSplitPane with two tables , when the application starts both tables contain the same data. The 1st table is a read view, the bottom display is an edit view. When I make a change to a table cell in the bottom view it changes colour and the corresponding cell in the top view also changes it colour (bit not value) to indicate that the cell has been edited.
The problem is that the top cell only changes colour if the top cell as displayed is large enough to show the complete value. If i then click on the cell in the top view it will correctly change colour. If I move the columns in the top pane about a bit, all subsequent modifications in the bottom pane will correctly change the cell colour in the top pane !
(My renderer extends JPanel rather than JLabel.)

Make sure you fire the appropriate fireTableCellUpdated() method from both TableModel's so that the view knows to redraw that cell. Ideally, both of your tables would share the same table model, but only one would allow editing. You could accomplish that by putting a facade table model over top the real table model that just overrode the isEditable method to reutrn false always, and all other methods would pass through to the real model. That way as changes were made to the table model (no matter who made the change), the views would stay in sync because they were based on the same model, getting all the same events, etc.

Similar Messages

  • Problem in table cell editor

    Hai,
    I inserted as a dropdownkey in table, Parent node ABc is bind to table , the child node DEf bind to coloumn dropdownbyindex. i set child node singleton as false, but its giving null pointer exception.
    IXXXView.IABCNode iu=wdContext.nodeABC();
    IXXXView.IDEFElement c=iu.nodeDEF().createDEFElement();
    How to Solve this.
    Hope  Anil and Piyush will help me they already know about this problem.
    regards,

    Hai Bharadwaj,
          happy to see you again, I think I am in wrong with creating table cell editor.
    i will say my requirement please help me to do:
    in the table the first coloumn is number, second one is name, third one is *** ,this coloumn contains two standard Strings male and female, the can select from dropdown index.
    what i did is I created context node parent ABC
    in that attributes name , age and another node DEF having attribute S.
    I created a table and bind the node ABC(its not allow me to check DEF node).
    i deleted table cell editor of column *** and created new editor dropdownindex. and binded texts is node DEF
    DEF is set to singleton false.
    Give me the suggetion.
    regrds,

  • Problem with table cells

    Hi,
    actually i wanted to know that is there any way
    so that i can show contents of a table cell in two pages, i.e, half the cell is in one page and other half of the cell on another page
    as my cell content is very large it do not fit in one page.
    I'm using InDesign CS3
    Thanks

    Hi,
    As I've already written in another post, that depends on, but I'm not sure that using a table structure is always the best way! 

  • Updating table cell

    Hi,
    I have a requirement for my application. I need to display a timer inside the cell of JTable. The table will be displaying records of multiple users visiting the site. The column should display the total time spent on the page. I am using a customized Table Model. How can I go about it?
    Thanks,
    Ajit

    Hi,
    See the following coding.
    In short,
    &lt b &rt tableModel.fireTableCellUpdated(row,column); &lt /b &rt
    raises the event. So that JTable will listen that event, and updates
    that particular cell only.
    You can create a thread, that keeps track of website visiting
    log of all persons. If the time change, you can invoke that method.
    import javax.swing.*;
    import javax.swing.border.DefaultTableModel;
    public class MyModel extends DefaultTableModel
    Object [] items;
              public MyModel(Object [] items) {
                   this.items=items;
              public int getColumnCount() {
                   return 2;
              public int getRowCount() {
                   return 4;
              public Object getValueAt(int row,int column) {
                   // The first column is fixed Item 1, Item 2, Item 3 etc.
                   if(column==0)
                        return "Person "+(row+1);
                   // The second column varies with "items".
                   else
                        return items[row]+" seconds";
    public static void main(String []args) {
              JFrame f=new JFrame("Testing single cell editor");
              final Object items[]=new Object[]{"1","2","3","4"};
              final MyModel model=new MyModel(items);
              // A table with 2 rows and 2 columns
              JTable table=new JTable(model);//new OurTableModel());
              // Set our editor as table's editor
              //table.setDefaultEditor(Object.class,new SingleCellEditor());
              // Add to a scroll pane
              JScrollPane pane=new JScrollPane(table);
              pane.setBounds(50,50,200,200);
              f.getContentPane().setLayout(null);
              f.getContentPane().add(pane);
              // Close on exit
              f.setDefaultCloseOperation(3);
              // Show the frame
              f.show();
              Thread t=new Thread() {
                   public void run() {
                        while(true) {
                                  try {
                                       Thread.sleep(1000);
                                       items[2]=""+(Integer.parseInt(""+items[2])+1);
                                       model.fireTableCellUpdated(2,1);
                                  catch (InterruptedException ignored)     {
              t.start();
    See that there my be compilation errors. But the logic is same. The same
    I applied and got it.
    Bye.. Bye..

  • Problem with table cell editors - Dropdown by Index, getting lead selection

    Hi experts,
    I have a table editor with 5 columns
    1st column is a Drop Down byIndex.
    My contex looks like this
    AS_DATA(Parent Node cardinality 1.1, selection 0-1)
          HEADER (NODE)
          DETAILS(NODE cardinality 0..n, selection 0-1)
             ACTIVITY_TYPES (NODE cardinality 0..n selection 0-1 ) "node for drop down
             description - attribute
             unit
             quantity
    i have bound details node to table data source.
    i have a tool bar button 'Add Line item' which will add a new line item to the table.
    (i am adding a blank line to the table that is bound to table )
    Its working fine. but when ever i add more than one row, the selection made in the previous rows drop down is lost.
    its initializing. where could be the problem.
    My code
    data LO_ND_INV_TYPE type ref to IF_WD_CONTEXT_NODE.
      data LO_EL_INV_TYPE type ref to IF_WD_CONTEXT_ELEMENT.
      data LS_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE.
      data LV_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE-INV_TYPE.
      data LO_ND_DETAILS type ref to IF_WD_CONTEXT_NODE.
      data LT_DETAILS type WD_THIS->ELEMENTS_DETAILS.
      data LS_DETAILS like line of LT_DETAILS.
      data:  WD_NODE type ref to IF_WD_CONTEXT_NODE,
            LR_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT.
      data LO_ND_INV_PATTERN type ref to IF_WD_CONTEXT_NODE.
      data LO_EL_INV_PATTERN type ref to IF_WD_CONTEXT_ELEMENT.
      data LS_INV_PATTERN type WD_THIS->ELEMENT_INV_PATTERN.
      data LV_INV_PAT type WD_THIS->ELEMENT_INV_PATTERN-INV_TYPE.
      data LO_ND_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_NODE.
      data LT_ACTIVITY_TYPES type WD_THIS->ELEMENTS_ACTIVITY_TYPES.
      data LW_ACTIVITY_TYPES type WD_THIS->ELEMENT_ACTIVITY_TYPES.
        data LO_EL_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_ELEMENT.
    *     navigate from <CONTEXT> to <DETAILS> via lead selection
        LO_ND_DETAILS = WD_CONTEXT->PATH_GET_NODE( PATH = `AS_DATA.DETAILS` ).
        LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(
          importing TABLE = LT_DETAILS ).
    * Append an empty row to lt_details
        append LS_DETAILS to LT_DETAILS.
        LO_ND_DETAILS->BIND_TABLE(
        NEW_ITEMS = LT_DETAILS ).
    * Get values for dropdown
    call method WD_ASSIST->GET_ACTIVITY_TYPE
          exporting
            I_INV_CAT_ID     = LV_INV_PAT
          importing
            ET_ACTIVITY_TYPE = LT_ACTIVITY_TYPES.
        LW_ACTIVITY_TYPES-ID = 'Select a Activity type'.
        LW_ACTIVITY_TYPES-TEXT = 'Select a Activity type'.
        insert LW_ACTIVITY_TYPES into LT_ACTIVITY_TYPES index 1.
        loop at LT_DETAILS into LS_DETAILS.
          LV_TABIX = SY-TABIX.
          LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
          WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
    *lv_index = wd_node->get_lead_selection_index( ). " it is dumping at this statement when i try to get lead selection
          WD_NODE->BIND_TABLE( NEW_ITEMS =  LT_ACTIVITY_TYPES ). " data for dropdown
        endloop.
    any clue on what am i missing will be appreciated.
    I am getting dump when i try to get the lead selection
    Ajay

    You only have only one option in the DDI to display in the example. when you have multiple values
    i assume that by adding an empty row like this will lose the SELECTION MADE in DDI. (Correct me If i am wrong)
    somehow i believe that we need to bind the DD values using  SET LEAD SELECTION INDEX METHOD FOR THE DDI when they are already selected and trying to BIND.
    *LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(*
          *importing TABLE = LT_DETAILS ).*
    ** Append an empty row to lt_details*
        *append LS_DETAILS to LT_DETAILS.*
        *LO_ND_DETAILS->BIND_TABLE(*
        *NEW_ITEMS = LT_DETAILS ).*
    even though the above code will have the selected value, the SELECTIONS MADE will be initialize.
    you need to bind it explicitly.
    you have to create an element and bind the DDI values for adding an row as SARAVANAN said.
    or i guess you can continue with you code but need to use SET LEAD to display the correct SELECTIONS MADE
    loop at LT_DETAILS into LS_DETAILS.
          LV_TABIX = SY-TABIX.
          LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
          WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
          WD_NODE->BIND_TABLE( NEW_ITEMS =  LT_ACTIVITY_TYPES ). " data for dropdown
    *" try to set the desired value in the DDI when you have multiple values using SET LEAD*
        endloop.

  • Updating table

    hi friends,
    i have one table in my application. i will update cells by enetering data into it. here the problem is after i typed digits i need to press
    ENTER or i need to press TAB to update the entered value into table cell. is there any way that without pressing ENTER or TAB to update table cell. and also i need to restrict max number of digits to 2. how can i do that. please help me in this proble. due to this a lot of bugs are coming for me.
    thanks and regard
    sriram

    hi sriram,
    Hope u might have implemented the key listener while typing if the in put key value of that cell is >2 put ,e.consume() will work out and further ur second query to update automatic is little bit odd any way u can do by fiering tableChangedListener in key pressed event .
    if u want brief help contact [email protected]

  • Spry Dataset (dynamic table) not displaying images

    Hi - new to Spry but loving it! I just did the tutorial for
    creating
    dynamic
    tables and had no problems outside of trying to get images to
    display in one tableset. in the XML I have
    <thumb><image href="imx/china.jpg"
    /></thumb>
    with thumb being the node name (naturally). the table cell
    displays nothing but all others have text displayed properly. is
    there no way of calling in images?
    Thanks for the help and advice!

    If you really want to embed HTML in XML, then read this
    sample:
    http://labs.adobe.com/technologies/spry/samples/data_region/HTMLFragsInXMLSample.html
    You can also just embed the path in the XML like this:
    <thumb>img/china.jpg</thumb>
    and then reference it in your region markup like this:
    <div spry:region="ds1">
    <img src="{thumb}" alt="{thumb}" />
    </div>

  • OCI to update table

    I have problem updating table using OCI. Would anyone provide a sample c program using OCI to update a tbale?
    Thanks,
    Luck

    The $OH/rdbms/demo directory contains many sample OCI programs that perform SQL updates.

  • Problem trying to update a table cell

    Hello all,
    I'm trying to implement a setValueAt method using an arrayList.....no success. Could anyone help?
    When trying to change the a value in the table I get these errors:
    "Exception occurred during event dispatching:
    java.lang.ClassCastException: java.lang.String
    at CachingResultSetTableModel.getValueAt(CachingResultSetTableModel.java:37)
    at javax.swing.JTable.getValueAt(JTable.java:1711)
    at javax.swing.JTable.prepareRenderer(JTable.java:3530)"
    public void setValueAt(Object avalue, int r, int c){
    if(r < cache.size()){
    row[c] = (Object[])cache.set(r, avalue);
    fireTableCellUpdated(r, c);
    }//setValueAt
    *********For reference here's the getValueAt method*************************
    public Object getValueAt(int r, int c){
    if(r < cache.size()){
    row = (Object[])cache.get(r);
    return row[c];
    else
    return null;
    }//getValueAt

    Hello,
    I am new at implementing this a table model and JTable, so all I am working with is the mainApp, the model, and the JTable. I am not too sure if and what listeners I should setup.
    I can compile the program. After the data is presented in the table, I try to change a value in one of the cells. Once I have clicked out of the cell I get the ClassCastException: java.lang.String error. I believe the exception is being created by the data I am entering. Do you know of any links that could help me figure how to properly update a cell.
    Determen

  • F4 display on a table cell

    I've a table cell which is bound to the 'Matnr" field. So in the display, I automatically get the F4 help, But in the display the F4 help button is not dispalying. If I press F4 on the cell, the search help opens up. But the users will not know that they have to press F4. Is there a way to indicate that F4 is availble on this field?
    Thanks,
    Ramesh

    Hi,
    I also faced the same problem.
    The solution is to apply OSS note 1359894.
    Thanks,
    Feroz

  • Problem with images inside of table cells

    I've run into a problem on this web page:
    http://www.solidrocknet.org/index2.html
    The the background of the table cells which contain an image
    is showing
    through in the form of a strip at the bottom of the cell. You
    can see
    this as a black strip in the cells which contain the logo
    graphic,
    centerpiece photo, and the photo strip and as a blue strip
    under the 4
    separate photos on the bottom.
    These problems are appearing in Firefox. It almost looks
    correct in
    IE6/7 except that the blue strip appears under the bottom
    photos.
    Can anyone see what I am doing wrong?

    The best practice is to include -
    a img { border:none; }
    in your CSS so that any image inside an anchor tag is
    prevented from having
    the border.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "K0rrupt" <[email protected]> wrote in
    message
    news:f5i5fc$bhp$[email protected]..
    > sometimes browsers like to display a blue lines around
    pictures. So as
    > good practice you should add it.
    >

  • Table cells/graphics do not display properly

    I'm trying to integrate some HTML code (developed outside of
    RoboHelp) for a somewhat complex table used to display a sliced
    graphic, background colors, etc. It looks fine in Dreamweaver, but
    when I paste the code into RoboHelp (true code pane), some of the
    graphic slices do not display properly, e.g., the slices in the
    bottom rows are offset slight and get repeated multiple times if I
    resize the window. I notice that RoboHelp seems to add a bunch of
    its own styles to my code, which might be part of the problem. Is
    this a known issue with RoboHelp? Should I not bother using outside
    HTML if it has some complexity to it?

    quote:
    Originally posted by:
    MergeThis
    ...and just what the heck is "a sliced graphic"?
    Hey, how can you learn, day after day, if you don't ask,
    right?
    I'm not an expert, mind you, but since I originated this
    post, I'll take a stab at it... "Slicing" a graphic is a technique
    used by Web desigers to design and display graphics more
    efficiently or more flexibly. It involves slicing up an image into
    several pieces like a jigsaw puzzle (often by using a program like
    Fireworks). The slices are chosen logically based on function,
    e.g., a designer might create a "banner" graphic to be used as a
    page header with navigation elements (buttons, text, etc) designed
    into the graphic. The graphic might be sliced up so that the
    navigation buttons are separate slices. This allows you to easily
    add hyperllinks to those individual slices. The part that gets
    tricky is that an HTML table must be generated along with the
    slices (with each slice in its own table cell) so that the pieces
    are displayed correctly, giving the appearance of one large
    graphic.

  • BRFplus: Problem updating values in an internal table in a loop expression

    Hi
    I'm looking into the loop expression type of BRFplus and I have come across a problem updating an internal table, I'm trying to create and populate the table using a loop, here is the functionality I'm trying to achieve:
    In a rule set create an internal MONTH_TBL table containing 12 rows of two columns: MONTH_NUM containing values 1 through 12 and MONTH_VAL containing an amount (initially 0,00 EUR in all 12 rows).
    After initializing the table traverse through SFLIGHT table and for each row add PRICE from the table to MONTH_VAL in the row of MONTH_TBL corresponding to the month of FLDATE field in SFLIGHT.
    The initialization of MONTH_TBL works as intended, as does the traversal of and retrieval of values from SFLIGHT. The problem however is the update of the internal table MONTH_TBL (defined as result data object for the function). I don't get an error, but the tables does not get updated, and I cannot seem to find out what the problem is. I would have attached an XML extract of the function + ruleset for information, but it dosen't seem like that is possible, I could e-mail it on request (for SAP employees with access to system QU5 the function is LOOP_TEST in application Z_KLAUS_TEST).
    I hope that this is sufficient information to understand the issue that I'm dealing with.
    best regards
    Klaus Stenbæk, KMD

    Hi Klaus,
    The Loop expression is part of NW 7.02 which is not yet released. When you experience the problem as part of a test you should have a contact at SAP for dealing with problems/errors. Usually SAP-internal messages are used for this purpose. Please clarify with your SAP contact how the model is.
    BR,
    Carsten

  • DYNP_VALUES_UPDATE to update table control cell

    How can I update a cell (e.g. in line n) value in a table control using the function DYNP_VALUES_UPDATE? Can someone give me an example?
    Thanks in advance.
    Adhimas S.

    Hi,
    Check this sample code
    REPORT ZVV.
    tables tcurt.
    DATA   DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
    PARAMETERS: P_WAERS LIKE TCURT-WAERS,        "Currency
                P_LTEXT LIKE TCURT-LTEXT,        "Long Text
                P_KTEXT LIKE TCURT-KTEXT.        "Short Text
    *--- Example of updating value of another field on the screen -
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.
      CLEAR: DYFIELDS[], DYFIELDS.
    *--- select currency
      CALL FUNCTION 'HELP_VALUES_GET'
           EXPORTING
                fieldname        =  'WAERS'
                tabname          =  'TCURT'
           IMPORTING
                SELECT_VALUE     =   P_WAERS.
    *--- get long text for the selected currency
      SELECT SINGLE LTEXT FROM TCURT
        INTO DYFIELDS-FIELDVALUE
        WHERE SPRAS = SY-LANGU
        AND   WAERS = P_WAERS.
      IF SY-SUBRC <> 0.
        CLEAR DYFIELDS-FIELDVALUE.
      ENDIF.
    *--- update another field
      DYFIELDS-FIELDNAME = 'P_LTEXT'.
      APPEND DYFIELDS.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
           EXPORTING
                DYNAME               = SY-CPROG
                DYNUMB               = SY-DYNNR
           tables
                dynpfields           = DYFIELDS .
    *--- Example of reading value of another field -
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.
    *--- read another field
      CLEAR: DYFIELDS[], DYFIELDS.
      DYFIELDS-FIELDNAME = 'P_WAERS'.
      APPEND DYFIELDS.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME                   = SY-CPROG
                DYNUMB                   = SY-DYNNR
           TABLES
                DYNPFIELDS               = DYFIELDS .
      READ TABLE DYFIELDS INDEX 1.
    *--- get short text and update current field
      SELECT SINGLE KTEXT FROM TCURT
        INTO P_KTEXT
        WHERE SPRAS EQ SY-LANGU
        AND   WAERS EQ DYFIELDS-FIELDVALUE.
    Thanks & Regards,
    Judith.

  • Mail.app: text in table cells in incoming formatted mail - problems replying

    MacOS 10.9.2
    mail.app  7.2, threading enabled
    Sometimes I receive a formatted email that is really difficult to reply to, when I want to intersperse my reply text among the incoming paragraphs.
    The trouble occurs when multiple incoming paragraphs are grouped. I can’t open up vertical space for my reply  text inside the groups. 
    If I click anywhere in the group, mail.app marks the group with a surrounding rounded-corner grey rectangle, with a X-in-a-circle “close icon” at the upper left corner. 
    When I look at the raw source of the incoming message, I see that the groups correspond to table cells, that is, the sending mail client enclosed the paragraphs within a <td> … </td> pair.
    The sending email client is sending me a table, for no clear reason — the group doesn’t correspond to anything obvious in the message thread.
    I’m guessing we won’t ever know why some email clients group paragraphs like this, but I’d like to do my best to adapt, so I can keep up with my incoming email. 
    Yeah, I can ask my correspondents to use a different email client, or perhaps different settings in the same client, but except for the few tekkies among my correspondents, this isn’t really practical.  I can also ask my clients to use unformatted messages, but THAT is a whole different issue, and frequently isn’t practical, either.
    My questions:
    Q1:  What’s the point of the grey rectangle and the  “close icon”?    (Is this mail.app’s way of saying, “I received this crazy formatting, almost impossible to process, so I’m making it easy for you to just delete the whole mess”?  Or what?)
    Q2:  Is there any SIMPLE way to untangle (modify or remove) these groupings within mail.app?  (I guess I can access the raw html, copy-and-paste it into another app, modify it, and paste the results back into my reply.  Yuck!)
    Q3: Am I missing a really obvious work-around or fix?
    TIA

    In your question, you indicated that you are running Firefox 8. Is that correct? It might be difficult to diagnose issues with that version because most people have moved on to Firefox 12 (plus or minus 1 version). Can you upgrade?
    It's hard to think of a reason that ordinary text or links in ordinary text would not display. For embedded images or videos, one possibility is a difference in the protocol, i.e., HTTP (not secure) versus HTTPS (secure).
    Hopefully someone else will have a better guess (or actual knowledge!).
    Regarding the blue lines in a message, that usually indicates the earlier message was forwarded a few times. I don't know whether Gmail will let you reformat that area or whether you have to clean it in another application (e.g., for plain text, in Notepad) and paste it back in.

Maybe you are looking for

  • Open file in a default editor

    Can any one tell me how can i get to know what is the default editor for a particular PC Is there any way to know what is the default editor ?? can JEditorPane be helpful.. The following is the code where i pass "winword" or "notepad" (which is hard

  • Help - Edit cell of a multicolumn listbox at run time

    Hi All, I am populating rows and columns of a multicolumn listbox from a file at run time. However, after the data is loaded in the listbox I want to have the option of changing cell value. Can I do that? If so, how? I appreciate your time and help.

  • Trying to remove movie clip with collision?

    I am creating empty movie clips and populating them with movie clips that have "drag and drop" functionality. I can create the empty movie clip and populate it with an external .swf. I've even got the drag-n-drop handled. But, I'd like to have them d

  • Material showing in system.

    Hi, We have some materials showing in SAP system. But physically we dont have that materials in plant. The only thing is in System it was  showing with some quantity. This quantity is reserved for some open sales orders in 2005. Now we need to delete

  • Keynote dies after approx. 63 slides

    Hello, I made an Keynote presentation on MAC and transfered it to the ipad. Works fine in general, BUT after approx. 63 slides the app becomes quite slow (reacts very slowly by tipping for the next slide) or dies at all. It dies reproducable after 63