On 8/10/2022 5:02 PM, Trevor DeVore via use-livecode wrote:
32,767 is the max for width as well. If there are enough columns it is
possible that the DataGrid is rendering a group that exceeds this limit and
hence the error. The DataGrid works around the limit when rendering rows,
but not when rendering columns.

I suppose a quick test would be to create a DataGrid with 330 columns that
are at least 100 pixels wide and see if you get the same error.


So I created 2 test stacks with a Datagrid and a button to set the number of columns and populate a row of data. One stack I did in Livecode 4.6.4 (the oldest I have) and one I built in Livecode 9.6.8 to see if there were differences in the handling of the error condition between versions of the Datagrid object.

[Note: Some of the Datagrids in our app are from LC 4.6.4 and we've never removed them and replaced them with newer versions and I don't believe Livecode does anything to automatically update the Datagrid objects in an old stack when opened in a new version of Livecode]

Under LC464, trying to create a number of columns with default widths that would exceed the 32,767 pixel width limit of the group object (using 330 columns with a default width of 100px or 33,000 pixels) produces:

1) A blank header (no columns)
2) Visible column for data, where only the visible columns of the first row (8 columns) are populated with data and when you scroll to the right, all remaining column of the 1st row of data are empty. The grid is scrollable horizontally to what looks to be around 320-330 columns.

Using 320 columns, works as expected. 325 works; 327 works. 328 only produces 327 columns in the header with 327 values for data in the first row. 329 produces a header with 329 columns and no data is rendered in the 1st row.

Under LC968, the LC968 test version of this with 330 columns produces:

1) Columns headers 1 to 8 (the header that are the visible width of the Datagrid)
2) No data is rendered and the grid is not scrollable.

Using 320 columns, works as expected. 325 works. 327 works. 328 produces 327 columns in the header and no data in the first row. 329 is the same as 330 (only 8 visible column headers and no data and no scrolling).

So, the results are subtly different from Datagrids from LC4.6.4 and Datagrids from LC9.6.8, but both fail to do what a user would expect without any visible errors.

However, having the number of columns exceed the width of a Livecode group object in pixels does not seem to be the source of the error I am trying to track down which was:

Line 139 set the dgProp["columns"] of grp "rwMatrixObj_DataGrid" to tColumnNames

tColumnNames is a variable containing a list of text lines that are customer entered column names, so they could be ANYTHING (up to 255 chars, no control characters, including DEL (127)) that a user could type or paste into a field, including words in any language using Unicode.

As the executionContexts data does not contain the actual values of the variable tColumnNames when the error occurs AND (for reasons) I can not get the data from the customer, does ANYONE have any idea what tColumnNames might contain that could produce the error(s) show below?

Technical information:
Property: value is not a number: (Line 11, column 1)
Object: can't set object property: (Line 11, column 5)
set: can't set property: (Line 11, column 1)
Handler: error in statement: LayoutControl (Line 11, column 1)
Object ID: stack "RevDataGridLibraryBehaviorsDefaultHeaderButtonBehavior"
-
repeat: error in statement: (Line 5066, column 1)
Handler: error in statement: _table.ResizeHeaders (Line 5052, column 1)
Object ID: stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior"
-
Handler: error in statement: _table.ResizeColumns (Line 4967, column 1)
Object ID: stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior"
-
Handler: error in statement: _table.CreateColumns (Line 4737, column 1)
Object ID: stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior"
-
Handler: error in statement: _table.RegenerateColumns (Line 4538, column 1)
Object ID: stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior"
-
switch: error in statement: (Line 6150, column 1)
Handler: error in statement: dgProps (Line 5553, column 1)
Object ID: stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior"
-
set: can't set property: (Line 5529, column 1)
Handler: error in statement: dgProp (Line 5529, column 1)
Object ID: stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior"
-
set: can't set property: (Line 139, column 1)
if-then: error in statement: (Line 139, column 1)
Handler: error in statement: populateMe (Line 138, column 1)
Object: group "Table" of card "FrequencyReport" of stack "FreqReport.rwtl"
Object ID: group id 1162 of card id 1002 of stack "/Applications/HyperRESEARCH 4.5.4/Components/Tools/FreqReport.rwtl"

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to