problem with tablemodel

View: New views
3 Messages — Rating Filter:   Alert me  

problem with tablemodel

by jarkkon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 but when I try to scroll down, the table gets messed up. 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. 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.

Here is a couble of pictures to demonstrate the problem.
http://koti.mbnet.fi/niempi2/start.JPG
http://koti.mbnet.fi/niempi2/scrolldown.jpg

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

  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.

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 table mode. The shareparse getdata() and getextradata-methods returns a two dimensional string table containing the data.

 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;
                        }
                    }

Re: problem with tablemodel

by Karol Harezlak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Could you report this bug in Issuezilla,
http://www.netbeans.org/kb/articles/issuezilla.html

Thanks,
Karol


jarkkon wrote:

> 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 but
> when I try to scroll down, the table gets messed up. 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. 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.
>
> Here is a couble of pictures to demonstrate the problem.
> http://koti.mbnet.fi/niempi2/start.JPG
> http://koti.mbnet.fi/niempi2/start.JPG 
> http://koti.mbnet.fi/niempi2/scrolldown.jpg
> http://koti.mbnet.fi/niempi2/scrolldown.jpg 
>
> Here is the code where the table displaying the data is created.
>
>   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.
>
> 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 table
> mode. The shareparse getdata() and getextradata-methods returns a two
> dimensional string table containing the data.
>
>  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;
>                         }
>                     }
>
>  


--
Karol Harezlak <karol.harezlak@...>
Sun Microsystems, Inc. NetBeans Mobility Pack
Phone: +420-233-009-481 , Mobile: +420-608-432-921

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: problem with tablemodel

by Lukas Hasik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It might be similar to http://www.netbeans.org/issues/show_bug.cgi?id=82141

Lukas.

Karol Harezlak wrote:

> Hi
>
> Could you report this bug in Issuezilla,
> http://www.netbeans.org/kb/articles/issuezilla.html
>
> Thanks,
> Karol
>
>
> jarkkon wrote:
>> 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
>> but
>> when I try to scroll down, the table gets messed up. 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. 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.
>> Here is a couble of pictures to demonstrate the problem.
>> http://koti.mbnet.fi/niempi2/start.JPG
>> http://koti.mbnet.fi/niempi2/start.JPG 
>> http://koti.mbnet.fi/niempi2/scrolldown.jpg
>> http://koti.mbnet.fi/niempi2/scrolldown.jpg
>> Here is the code where the table displaying the data is created.
>>
>>   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.
>>
>> 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 table
>> mode. The shareparse getdata() and getextradata-methods returns a two
>> dimensional string table containing the data.
>>
>>  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;
>>                         }
>>                     }
>>
>>  
>
>

[lukas_hasik.vcf]

begin:vcard
fn:Lukas Hasik
n:Hasik;Lukas
org:Sun Microsystems;Mobility Pack QE
email;internet:lukas.hasik@...
note;quoted-printable:Need a help with Mobility Pack/Java ME?=0D=0A=
        Ask at <a href=3D"http://mobility.netbeans.org/servlets/SummarizeList?lis=
        tName=3Dusers">users@...</a>
x-mozilla-html:TRUE
url:http://blogs.sun.com/lukas
version:2.1
end:vcard




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...
LightInTheBox - Buy quality products at wholesale price