Page 1 of 1

255 character limit on $record->display() ?

PostPosted: Thu May 07, 2009 9:41 am
by rugcutter
I'm trying to output the value from a column that is of type "text" in the database table. I'm seeing that the method call to $record->display() is only giving me the 1st 255 characters of the field.

I'm making the call within renderRow() within my delegate class. I wrote code to output the value within an HTML comment block, and I'm only getting the 1st 255 characters. My code looks something like this:

Code: Select all
   function renderRow ( &$record )
   {

      print("<!-- RAC notes ".$record->display(cp_notes)."-->");
      print("<!-- RAC notes ".$record->getValueAsString(cp_notes)."-->"); // this also only gives me the 1st 255 characters
   
   ...


I've tried getValueAsString(), and a few other functions on the Record class as well.

Where is this limit set? How can I indicate to give me the full value that is stored in the table?

PostPosted: Thu May 07, 2009 9:55 am
by shannah
In list view, for performance reasons, only the first 255 chars of each field is loaded into memory. If you require a field to always load the entire contents you can specify struct=1 for that field in the fields.ini file:

e.g.
Code: Select all
[myfield]
     struct=1



-Steve

PostPosted: Thu May 07, 2009 10:06 am
by fongchun
Might want to check out this post too. It contains a little more information on the situation and some other solutions.

PostPosted: Thu May 07, 2009 11:02 am
by rugcutter
Exactly what i needed. Thanks for the quick response!