Clarity

Expand all | Collapse all

Line Break in text Field

Jump to Best Answer
  • 1.  Line Break in text Field

    Posted 03-14-2018 09:07 AM

    Hello,
    I have created an attribute for the projects that acquires the value dynamically through a parameterized lookup.
    This new attribute is of type lookup string. The attribute contains the value of a project field of type large string that contains comments.
    The problem is that when the value is assigned to the new attribute it is not shown with the line breaks that appear in the original attribute. I have tried with <br>, \ r, \ n, chr (10), chr (13), <! [CDATA []]>, without getting the desired result.
    Does anyone have any Idea?

     

    origin attribute:

     

    new attribute:

     

    LOOKUP QUERY:

     

    Thank you very much in advance.



  • 2.  Re: Line Break in text Field

    Posted 03-14-2018 09:37 AM


  • 3.  Re: Line Break in text Field

    Posted 03-15-2018 02:35 AM

    Hello,

    Thanks for answering.
    I have tried the following but with an unsatisfactory result.
    In the query of the lookup, I replaced the line breaks with elements <br>.

     

    But the result has been this:



  • 4.  Re: Line Break in text Field

    Posted 03-14-2018 12:52 PM

    Strangely I've had some success with the technique by using <br> in the text ; not really sure of the pattern of behaviour though.



  • 5.  Re: Line Break in text Field

    Posted 03-15-2018 04:06 AM

    Changing the attribute display type to 'pull down' might work



  • 6.  Re: Line Break in text Field

    Posted 03-15-2018 04:56 AM

    Hello,
    It does not work, the result is the same.



  • 7.  Re: Line Break in text Field
    Best Answer

    Posted 03-15-2018 07:42 AM

    Weird ; as I said I'm not really sure what the pattern is, I had a little play with my Views -> [Fields] settings...

     

    (the NSQL in my lookup is much the same as yours, on Oracle and replacing chr(10) with <br> in the string - maybe I have one less to_char in my statement as I don't think you need the outer one?)

     

    If I set the "Display Type" to pull-down and check "Enter Once" - I get line breaks OK on my object page

    If I set the "Display Type" to pull-down and un-check "Enter Once" - I get a single edittable line with <br> visible in the text (i.e. wrong)

    If I set the "Display Type" to browse and un-check "Enter Once" - I get a truncated edittable line with <br> visible in the text (i.e. very wrong)

    If I set the "Display Type" to browse and check "Enter Once" - I get a single un-edittable line with <br> visible in the text (i.e. wrong ; the same as your last screenshot)

     

    (this is in an older 13.x version of the UI though, that might make a difference?)

     

    --

     

    If you "hard code" some text with <br> in it in your lookup (just as a test) what happens?

     

    eg

    SELECT 'aaa<br>bbb<br>ccc<br>' as COMENTARIO

    from niku.odf_ca_inv

    ...



  • 8.  Re: Line Break in text Field

    Posted 03-16-2018 03:08 AM

    Hello David,
    Thank you so much for your answer.
    The problem with respect to the solution you propose is that I need that field can be modified as many times as necessary, and if I checked the option "Enter Once", would it still be editable?



  • 9.  Re: Line Break in text Field

    Posted 03-16-2018 04:28 AM

    if you are trying to follow the technique from here ; TIP : How To Put Any Dynamically Generated Value On A Clarity Object  (and it does look like you are doing that) then the idea is that the value of the underlying field ("bcc_comentario_bp" in your NSQL) can of course change, it is the value of the "dummy field" (the one that the lookup is associated with) that never changes (its value is always "1") - and its that dummy field that we set to "enter once".



  • 10.  Re: Line Break in text Field

    Posted 03-18-2018 10:06 PM

    Your Lookup will always return exactly the same value on that Object.  Are you sure you want this attribute to be a 'look-up'.  If you want this attribute to 'editable', then are you better off having a Process that automatically runs on create, which populates the string attribute with the 'default' value.  Users can then edit the string attribute many times.

     

    Hopefully when the string attribute is created, is also has the required 'returns'.



  • 11.  Re: Line Break in text Field

    Posted 03-21-2018 02:45 AM

    Perfect David,
    The solution was:
    Display type = pull-down and check "Enter Once". Now that it recognizes the element <br>.
    Thank you very much