Get a Jumpstart with our Sample Apps
Results 1 to 7 of 7

Thread: How to define fields in a formview so that linebreaks are displayed

  1. #1
    Member cptutrecht's Avatar
    Real Name
    Ger Kurvers
    Join Date
    Feb 2010
    Location
    Netherlands, Utrecht
    Posts
    513

    Default How to define fields in a formview so that linebreaks are displayed

    My last question for today :-)


    I have a field defined as mediumtext in a Mysql Database. It does contain linebreaks, but is not html.
    In a formview (see attached image) the linebreaks don't show.

    The text-area editor for that field however displays the linebreaks correctly.

    How can I define the field in the formview so that there also the linebreaks are respected?

    Thanks in advance

    fornview.PNG
    Ger Kurvers
    Alpha Anywhere / V4.4.5 - Build 4491_4932 30-July-2017
    Development: Mysql, windows 7 64 Applicationserver: standard on Windows server 2012 R2

  2. #2
    Member cptutrecht's Avatar
    Real Name
    Ger Kurvers
    Join Date
    Feb 2010
    Location
    Netherlands, Utrecht
    Posts
    513

    Default Re: How to define fields in a formview so that linebreaks are displayed

    I see a lot of views, but no reactions. Maybe because i didn't provide enough information.
    Didn't find a solution, so I hope the screenshots below make the problem and question clearer. It's a breaking problem for me, for using formviews and editors...

    Editor screenshot: the note field displays linebreaks correct
    Formview screenshot: the note field displays without linebreakes
    Formview definition screenshot: the highlighted placeholder represents the note field: how should i change that to show the linebreaks in the formview?


    Thanks in advance
    Editor.PNGFormview.PNGFormviewDefinition.PNG
    Ger Kurvers
    Alpha Anywhere / V4.4.5 - Build 4491_4932 30-July-2017
    Development: Mysql, windows 7 64 Applicationserver: standard on Windows server 2012 R2

  3. #3
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,194

    Default Re: How to define fields in a formview so that linebreaks are displayed

    Part of the problem is that it takes time to try and duplicate what you have. Providing a simple sample with a simple table (or even static data in this case) goes a long way for these types of posts. More so, there are so many options to mix and match that my sample will undoubtedly be different than yours.

    That being said, I've built an example and changed the FormView layout just a bit.

    Instead of using a <span> tag... which doesn't understand formatting... change it to a <textarea> tag... and then style it so that it doesn't have a border, ext.

  4. #4
    Member cptutrecht's Avatar
    Real Name
    Ger Kurvers
    Join Date
    Feb 2010
    Location
    Netherlands, Utrecht
    Posts
    513

    Default Re: How to define fields in a formview so that linebreaks are displayed

    Thanks David for looking in to it.

    I replaced the span tag with:
    <textarea style="padding:1%;margin:5px 0;width:90%;border-color: Transparent;">{Relaties_opmerkingen}</textarea>
    But the result is worse (see screenshot below):
    1. linebreaks are preservered but in the textarea also all html generated by Alpha is shown
    2. the textarea editor doesn't popup any more.

    It's almost tomorrow here, will try to make tomorrow a simple test component, perhaps based on northwind.

    FormviewWithTextareaTag.PNG
    Ger Kurvers
    Alpha Anywhere / V4.4.5 - Build 4491_4932 30-July-2017
    Development: Mysql, windows 7 64 Applicationserver: standard on Windows server 2012 R2

  5. #5
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,194

    Default Re: How to define fields in a formview so that linebreaks are displayed

    Then a sample is warranted... my FormView, TextArea Editor, all based on a SQL List, looks, and behaves, well... so it's down to settings.
    I added a bit of Javascript to the List "onSelect" to ensure the FormView Field is properly sized for "rows"... but stuff like this usually needs few tweaks.
    FormView_TextArea.PNG

  6. #6
    Member cptutrecht's Avatar
    Real Name
    Ger Kurvers
    Join Date
    Feb 2010
    Location
    Netherlands, Utrecht
    Posts
    513

    Default Re: How to define fields in a formview so that linebreaks are displayed

    Thanks David, your remarks about textarea tag and settings lead me to the solution.

    One should not place them in the freeform layout of the layoutcontainer, but adjust the template for the field that is injected into that container.
    As always, AA requires only 5 minutes to tweaks but it can take hours to find the correct spot where to tweak.

    In the screenshot the result and the adjustments I made, just for future reference

    FormviewOk.PNGFieldTemplateSolution.PNG
    Ger Kurvers
    Alpha Anywhere / V4.4.5 - Build 4491_4932 30-July-2017
    Development: Mysql, windows 7 64 Applicationserver: standard on Windows server 2012 R2

  7. #7
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,194

    Default Re: How to define fields in a formview so that linebreaks are displayed

    Glad it worked out for you. My test has the <textarea> tag in the Layout without issue, but it follows the rules of the Layout Template. Your original attempt didn't.

    By using the default sample Field Template, you're now following the template rules. So... utilizing either the Field or Layout template works... as long as the syntax is correct.

    Inspect the rendered page and you'll see it.

Similar Threads

  1. Cannot Define External Fields in Linked Report
    By mgallardo in forum Windows Desktop Applications
    Replies: 0
    Last Post: 04-25-2017, 06:36 PM
  2. Replies: 2
    Last Post: 04-19-2017, 09:36 AM
  3. Define Calculated Fields Screen issue?
    By peterg000 in forum Alpha Five Version 6
    Replies: 3
    Last Post: 10-08-2005, 12:43 PM
  4. Error Message - Define Calc. Fields
    By Elke in forum Alpha Five Version 6
    Replies: 5
    Last Post: 03-02-2005, 07:05 AM
  5. Use a loop to define fields?
    By Bill Warner in forum Alpha Five Version 4
    Replies: 3
    Last Post: 04-03-2000, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •