I've got a rev app I'm working on that displays db data in a table-style datagrid. DB text fields that are intended to contain potentially long prose/notes/etc, which would include linefeeds in the content, are giving me trouble.
In Rev, I can write to the DB just fine, even when my text-to-save contains linefeeds. However, when I try to read the data out and put it into a datagrid, the linefeeds inside the text field are goofing things up. My dg-populating script is interpreting the linefeeds in the text field as a new record, which is not entirely unexpected.
I have tried to use a substitution method, wherein the linefeeds are not stored as such in actuality, but a replacement character set that would almost never come up on its own is used. However, when I try to convert that character set back into linefeeds inside the field's Custom Behavior, I get some really wild results, culminating in a "bad parameter" error in the FillInData behavior.
So, what would be the best way to store & display long db text fields with linefeed-containing data inside a datagrid?
For reference, here are my relevant script bits:
the script which populates the dgData from the DB:
Code: Select all
if tResultID ="" then repeat for each item thisField in myFields put "" into notesArray[tNoteCount][thisField] end repeat else put revDataFromQuery(,,gConID, tSQL) into tResultData set the itemdelimiter to tab put 0 into n repeat for each line thisLine in tResultData add 1 to n put 0 into i repeat for each item thisField in myFields add 1 to i put item i of thisLine into notesArray[n][thisField] end repeat end repeat end if set the dgData of group "notes_dglist" to notesArray
Code: Select all
on FillInData pData set the text of field 1 of me to replaceText(pData, "|*|", cr) end FillInData