Problem with removeRows command in Simple table model

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with removeRows command in Simple table model

dvora lopez
Hi,

I'm working with Simple table model.  I have a delete button.  When the user presses delete, I want to remove the row selected from the model.
My command for this is:

tableModel.removeRows(index_of_row_selected,1);

I keep getting messages like this one:
this.__rowArr out of bounds: 11 (0..11)
where the 11 is the number of rows in the table.


index_of_row_selected is less than the number of rows in the table.

Anybody have any suggestions?
TIA.

Dvora Lopez
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem with removeRows command in Simple table model

Tristan Koch
Hi Debora,

so in other words tableModel.getData().length is greater than index_of_row_selected?

index_of_row_selected is positive?

Regards
Tristan

Am 02.04.2012 um 09:52 schrieb Debora Lopez:

> Hi,
>
> I'm working with Simple table model.  I have a delete button.  When the user presses delete, I want to remove the row selected from the model.
> My command for this is:
>
> tableModel.removeRows(index_of_row_selected,1);
>
> I keep getting messages like this one:
> this.__rowArr out of bounds: 11 (0..11)
> where the 11 is the number of rows in the table.
>
> index_of_row_selected is less than the number of rows in the table.
>
> Anybody have any suggestions?
> TIA.
>
> Dvora Lopez ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure_______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem with removeRows command in Simple table model

dvora lopez
Hi,

I managed a work-around today.  I finally realized that the row was being removed from the model, even though the exception was being raised.  So, I put the removeRows command in a try-catch and ignore the exception.  I don't like doing this - because it could cause other problems, but that's my solution for now.

Regards,
Dvora



From:        Tristan Koch <[hidden email]>
To:        qooxdoo Development <[hidden email]>
Date:        04/04/2012 14:35
Subject:        Re: [qooxdoo-devel] Problem with removeRows command in Simple        table        model




Hi Debora,

so in other words tableModel.getData().length is greater than index_of_row_selected?

index_of_row_selected is positive?

Regards
Tristan

Am 02.04.2012 um 09:52 schrieb Debora Lopez:

> Hi,
>
> I'm working with Simple table model.  I have a delete button.  When the user presses delete, I want to remove the row selected from the model.
> My command for this is:
>
> tableModel.removeRows(index_of_row_selected,1);
>
> I keep getting messages like this one:
> this.__rowArr out of bounds: 11 (0..11)
> where the 11 is the number of rows in the table.
>
> index_of_row_selected is less than the number of rows in the table.
>
> Anybody have any suggestions?
> TIA.
>
> Dvora Lopez ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
>
http://p.sf.net/sfu/sfd2d-msazure_______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem with removeRows command in Simple table model

fritz
Dvora,

could it be that you have e selection callback handler in place that somehow
is called when the row is removed (and thus the selection disappears or
changes)? At least if you removed the last row of the table that would most
likely create a problem.

I remember vaguely to have had a similiar problem and had either disabled
the selection handler temporarily or changed something else in my code
(sorry to not be able to be more specific). Another thing I remember is that
I had a for-loop once inside which I removed rows. This obviously fails if
you iterate through the for-loop in a forward direction (increasing index),
as the length after removing a row is smaller than when the for-loop
started. If you run the for-loop backwards (from i=length-1 to 0) then this
problem does not occur.

Just some thoughts, I doubt that you are running into a Qooxdoo-bug, but
rather some not obvious problem in your code.

Cheers,
Fritz

On Wed, 4 Apr 2012, Debora Lopez wrote:

> Hi,
>
> I managed a work-around today.  I finally realized that the row was being
> removed from the model, even though the exception was being raised.  So, I
> put the removeRows command in a try-catch and ignore the exception.  I
> don't like doing this - because it could cause other problems, but that's
> my solution for now.
>
> Regards,
> Dvora
>
>
>
> From:   Tristan Koch <[hidden email]>
> To:     qooxdoo Development <[hidden email]>
> Date:   04/04/2012 14:35
> Subject:        Re: [qooxdoo-devel] Problem with removeRows command in
> Simple  table   model
>
>
>
> Hi Debora,
>
> so in other words tableModel.getData().length is greater than
> index_of_row_selected?
>
> index_of_row_selected is positive?
>
> Regards
> Tristan
>
> Am 02.04.2012 um 09:52 schrieb Debora Lopez:
>
>> Hi,
>>
>> I'm working with Simple table model.  I have a delete button.  When the
> user presses delete, I want to remove the row selected from the model.
>> My command for this is:
>>
>> tableModel.removeRows(index_of_row_selected,1);
>>
>> I keep getting messages like this one:
>> this.__rowArr out of bounds: 11 (0..11)
>> where the 11 is the number of rows in the table.
>>
>> index_of_row_selected is less than the number of rows in the table.
>>
>> Anybody have any suggestions?
>> TIA.
>>
>> Dvora Lopez
> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>>
> http://p.sf.net/sfu/sfd2d-msazure_______________________________________________
>
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>

--
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem with removeRows command in Simple table model

dvora lopez
Thanks for the reply.
I'm not even sure what a selection callback handler is - so I don't think I use one.  I just have a listener on the button for Delete.  But I'll look into that.

I always get the exception, even if it's not the last row being deleted.
My deletes are in fact in a loop, but I knew to iterate backwards.  Also, I get the exception even if I'm deleting only one row.

If you remember what problem you had - I'd really appreciate any hints.  Yes, I assume it's a code problem of mine.  Just can't figure it out yet.  If it helps to know - I'll add one more bit of information.  It took a while to realize that the row was being removed (despite the exception), because it only displayed properly (as removed) when I clicked on another row.  I took care of that programatically by adding a resetSelection command.  

Thanks again for trying to help.

Regards,
Dvora



From:        Fritz Zaucker <[hidden email]>
To:        qooxdoo Development <[hidden email]>
Date:        04/04/2012 15:29
Subject:        Re: [qooxdoo-devel] Problem with removeRows command in Simple table model




Dvora,

could it be that you have e selection callback handler in place that somehow
is called when the row is removed (and thus the selection disappears or
changes)? At least if you removed the last row of the table that would most
likely create a problem.

I remember vaguely to have had a similiar problem and had either disabled
the selection handler temporarily or changed something else in my code
(sorry to not be able to be more specific). Another thing I remember is that
I had a for-loop once inside which I removed rows. This obviously fails if
you iterate through the for-loop in a forward direction (increasing index),
as the length after removing a row is smaller than when the for-loop
started. If you run the for-loop backwards (from i=length-1 to 0) then this
problem does not occur.

Just some thoughts, I doubt that you are running into a Qooxdoo-bug, but
rather some not obvious problem in your code.

Cheers,
Fritz

On Wed, 4 Apr 2012, Debora Lopez wrote:

> Hi,
>
> I managed a work-around today.  I finally realized that the row was being
> removed from the model, even though the exception was being raised.  So, I
> put the removeRows command in a try-catch and ignore the exception.  I
> don't like doing this - because it could cause other problems, but that's
> my solution for now.
>
> Regards,
> Dvora
>
>
>
> From:   Tristan Koch <[hidden email]>
> To:     qooxdoo Development <[hidden email]>
> Date:   04/04/2012 14:35
> Subject:        Re: [qooxdoo-devel] Problem with removeRows command in
> Simple  table   model
>
>
>
> Hi Debora,
>
> so in other words tableModel.getData().length is greater than
> index_of_row_selected?
>
> index_of_row_selected is positive?
>
> Regards
> Tristan
>
> Am 02.04.2012 um 09:52 schrieb Debora Lopez:
>
>> Hi,
>>
>> I'm working with Simple table model.  I have a delete button.  When the
> user presses delete, I want to remove the row selected from the model.
>> My command for this is:
>>
>> tableModel.removeRows(index_of_row_selected,1);
>>
>> I keep getting messages like this one:
>> this.__rowArr out of bounds: 11 (0..11)
>> where the 11 is the number of rows in the table.
>>
>> index_of_row_selected is less than the number of rows in the table.
>>
>> Anybody have any suggestions?
>> TIA.
>>
>> Dvora Lopez
> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>>
>
http://p.sf.net/sfu/sfd2d-msazure_______________________________________________
>
>> qooxdoo-devel mailing list
>> [hidden email]
>>
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
>
http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>

--
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web:
www.oetiker.ch

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel