History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-1948
Type: Bug Bug
Status: Open Open
Priority: P1 P1
Assignee: Max Carlson
Reporter: Brendan Fagan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

'less than' character in gridtext and inputtext truncating line

Created: 11/Apr/06 10:35 AM   Updated: Tuesday 06:20 AM
Component/s: Components - LZ, LFC - Text, Components - grid
Affects Version/s: 3.1.1 (aka Quill)
Fix Version/s: HoneyDew (4.2b2)

Time Tracking:
Not Specified

File Attachments: 1. File cdata_text_testcase.lzx (0.5 kb)


Severity: Major
Runtime: N/A
Release Note Text: text, inputtext and gridtext fields truncate strings at the introduction of "<"
Fix in hand: True


 Description  « Hide
This has been bugging me for a bit:

text, inputtext and gridtext fields truncate strings at the introduction of <

After some investigation, I discovered the issue is a problem with the evaluation of the width. Here's a change I made to gridttext:

<inputtext visible="${!parent.editing}"
width="${parent.width}" y="$once{ parent.height /2 - this.height/2}"
fgcolor="${ parent.immediateparent.selected ?
                                    classroot._textselectedcolor:
                                    (parent.immediateparent.highlighted ?
                                                classroot._texthilitecolor:
                                                classroot._textcolor)}"
datapath="$once{parent.parent.rowdp}">
<method event="ontext">
this.setWidth(this.getTextWidth());
</method>
<method event="oninit">
this.setEnabled(false);
</method>
</inputtext>

'Less than' characters now work correctly. This doesn't seem to help the text component though.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jim Grandy - 13/Jun/06 03:00 PM
Amy, please verify contributor's agreement.

Amy Muntz - 15/Jun/06 12:02 PM
Agreement in place. Jim, please let me know when this is integrated. Thanks.

Josh Crowley - 30/Jan/07 02:54 AM
Note: This does not occur in DHTML.

Also, it doesn't seem to effect inputtext. It only seems to affect text and gridtext.

Josh Crowley - 30/Jan/07 03:26 AM
Upon investigation, this seems to be a larger issue than depicted, having to do with the difference in how literal data is interpreted with and without CDATA tags.

Given the following text object:

<text name="boo" visible="true" width="300" y="70" text=" "/>

And a button with one of two methods, the following will result in truncated text:

<method event="onclick">
canvas.boo.setText('herring &lt; bobby');
</method>

Whereas this will display the text appropriately:

<method event="onclick"><![CDATA[
canvas.boo.setText('herring &lt; bobby');
]]></method>

I've been researching this, and will investigate further, posting comments with updates.

Josh Crowley - 30/Jan/07 03:56 AM
Okay, I've created a solution to this, but it's rather contrived as it involves searching every string in which a "<" is present and replacing it with "&lt;" within a <![CDATA[ ]]>-enclosed method. It works, but there's probably a quicker way, and I'm not sure if it's going to cause problems elsewhere. I'll keep working on it.

Josh Crowley - 01/Feb/07 07:54 AM
After conferring with Henry, I'm assigning this to Max. This has different behavior in DHTML and SWF.

There is no option to set a text object to HTML or plaintext.

Josh Crowley - 22/Feb/07 01:22 PM
Attaching test case.