NetTalk Central

Author Topic: Displaying a large string field or memo on a browse  (Read 3199 times)

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Displaying a large string field or memo on a browse
« on: January 26, 2012, 01:42:30 PM »
Is it possible to display more than 255 characters of a memo field in a NetWebBrowse row?  If I set the field picture larger the @S255 then nothing is displayed. When picture @S255 is used the first 255 characters are displayed and the field is wrapping the text nicely within the row, but I need to show around 1000 characters. I am sure I have seen large blocks of text on NetWebBrowse before. How is it done?

linas@debetas.lt

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • Email
Re: Displaying a large string field or memo on a browse
« Reply #1 on: January 26, 2012, 03:19:53 PM »
Hi,
Do not use picture.  It works with the xtml in a row displaying very long strings.

Linas

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Displaying a large string field or memo on a browse
« Reply #2 on: January 26, 2012, 03:48:48 PM »
Excuse my ignorance, please explain how do this?  The NetWebBrowse field template has two types String or Button. I selected “string” and the memo field from the table in the browse. If I clear the picture field and the template puts the picture back . I have check on  “Allow XHTML in column” for the field. Still only 255 characters appear in the colum of the browse.
Thanks
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Displaying a large string field or memo on a browse
« Reply #3 on: January 27, 2012, 12:25:34 AM »
hmm - yeah, this is cunning. So basically what's happening is that if the field is _blank_ then the template spots this, and fills in a reasonable default for you. This is typically a picture from the dictionary, or it could be a prompt field, or a comment field (also taken from the dictionary) and so on.

the way to override this behaviour when you explicitly want it to be blank, is to put an empty string there. In other words, set the picture to
''
That way the template doesn't see it as "blank" - but you also don't restrict the length of the field you want to display.

Another cunning tip is to put say the first 250 chars in the column, but put all the text into the Field Tooltip. that way the user sees a short text, but if they mouse-over it, they see a long one. This isn't so cool on touch devices (where there is no mouse hover). another approach is to have the big text, but put it on a line by itself (like in example 50) and then make the browse row contract and expand. (I think you've thought of this too)

cheers
Bruce

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Displaying a large string field or memo on a browse
« Reply #4 on: January 27, 2012, 08:02:51 AM »
Hi Bruce,
I set the picture field to '' and still only 255 characters appeared. Any split up of this text into three rows would look unprofessional, due to resizing of the browser window which would cause uneven text wrap.   Is there hand code  that could be added to  field’s value routine to pump text into the cell of the HTML table  prepared for this browse column?  It appears that the CreateHyperLink method is truncated the text.
Robert Kolanko

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Displaying a large string field or memo on a browse
« Reply #5 on: January 27, 2012, 08:35:26 AM »
So to answer my own question. In the field’s value routine embed, I copied the generated code but replaced the “CreateHyperLink” method with a simple CLIP() around the variable and the actual generated code below is omitted. Now all the text appears in the column. The browse appears to work fine.  This browse has no headers or sorting on this field. Are there any problems that I have caused that I do not know about yet?
Thanks
Robert Kolanko

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Displaying a large string field or memo on a browse
« Reply #6 on: January 27, 2012, 08:32:18 PM »
I'm not getting the clipped effect you mentioned here in my test. But I was generating a large amount of text in the "display" field. Perhaps try putting just the field name in the display field as well, and see what happens. If that doesn't work, I'd love to see your app.

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Displaying a large string field or memo on a browse
« Reply #7 on: January 30, 2012, 12:00:57 AM »
Yes, placing the field name in the display field works too and does not require any embedded code. Thus is better than my method. The template generated code uses the "CreateTextArea" method instead of the "CreateHyperLink" method which was truncating the field text. Thanks bruce2

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Displaying a large string field or memo on a browse
« Reply #8 on: January 30, 2012, 12:12:21 AM »
good to know, thanks for the feedback.