×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    9

    problem with tablemodel

    i have created a table using the netbeans 5.5 table model and it works fine on emulator, however on an s60 nokia device, i cannot seem to scroll down the table. When the table first loads the table is displayed allright (picture)but when I try to scroll down, the table gets messed up(picture). However the data seems to be loaded into the tablemodel because if i move the cursor down and select a row, the right row is selected it just is not displayed properly on the screen.




    Here is the code where the table displaying the data is created.

    Code:
      public org.netbeans.microedition.lcdui.TableItem get_infoTable() {
            if (infoTable == null) {
                // Insert pre-init code here
                infoTable = new org.netbeans.microedition.lcdui.TableItem(getDisplay(), "Ahlstrom", get_infoModel());
                // Insert post-init code here
            }
            return infoTable;
        }
    And here is the code where tablemodel is created.

    Code:
    public org.netbeans.microedition.lcdui.SimpleTableModel get_infoModel() {
            if (infoModel == null) {//GEN-END:MVDGetBegin36
                // Insert pre-init code here
                infoModel = new org.netbeans.microedition.lcdui.SimpleTableModel();//GEN-BEGIN:MVDGetInit36
                infoModel.setColumnNames(null);
                // Insert post-init code here
            }
            return infoModel;
        }

    And finally here is the code where actual data is loded in to the tablemodel. The shareparse getdata() and getextradata-methods returns a two dimensional string table containing the data.
    Code:
     for(int i = 0; i < shareParser.getData().length; i++)
                        {
                            if(selected.compareTo(shareParser.getData()[i][0]) == 0)
                            {
                                selectedshare = i;
                                returnForm = favForm;
                                
                                // Go to infoform only if favorite share was found from shareparser
                                getDisplay().setCurrent(get_infoForm());
     
                                
                                // Update info model
                                infoTable.setLabel(shareParser.getData()[i][0]);
                                infoModel.setValue(1, 0, shareParser.getData()[i][1]);
                                infoModel.setValue(1, 1, shareParser.getData()[i][2]);
                                infoModel.setValue(1, 2, shareParser.getExtraData()[i][1]);
                                infoModel.setValue(1, 3, shareParser.getExtraData()[i][2]);
                                infoModel.setValue(1, 4, shareParser.getExtraData()[i][3]);
                                
                                break;
                            }
                        }

  2. #2
    Registered User
    Join Date
    Feb 2007
    Posts
    9

    Re: problem with tablemodel

    It seems that if I change number of rows in the table with netbeans ui desinger for example to 10, 10 first rows in the table are displayed properly. So it seems that the table is not resized properly when new data is added to it. Is there anyway to reset the number of rows or repaint the org.netbeans.microedition.lcdui.TableItem class.

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •