Changes between Initial Version and Version 3 of Ticket #5580


Ignore:
Timestamp:
Jan 14, 2008, 11:57:35 PM (12 years ago)
Author:
bill
Comment:

Hi. The comment for renderAsHtml says:

// renderAsHtml: Boolean
//		Set this to true if the specified Editor's value should be interpreted as HTML
//		rather than plain text (ie, dijit.Editor)

which is meant to mean that you set renderAsHtml to true only for widgets where setDisplayValue()/getDisplayValue() take HTML, which I think is *just* the editor at this point. It's not Textarea, which is plain text. You are using the default value of renderAsHTML = false, right?

Since InlineEditBox?.value is HTML, InlineEditBox?.edit() need to convert it to plain text before passing the value to TextBox?, which means that the replace() should happen, and it does happen since renderAsHtml is false. So the order looks correct to me.

You are right about the replace(" ") call.

It's good that you listed where you think the error in the code is, but can you also write down what actual problem you are seeing, and attach a test case if the test_InlineEditBox.html file isn't sufficient to reproduce the problem? Thanks!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5580

    • Property Milestone changed from 1.0.3 to 1.1
    • Property Severity changed from critical to normal
  • Ticket #5580 – Description

    initial v3  
    11In InlineEditBox.js at line 129 the renderAsHtml flag is used to determine whether to replace characters for wrapping and such.  The line looks like this:
    2 
     2{{{
    33var editValue =
    44                                (this.renderAsHtml ?
     
    88s*/g,"").replace(/<br/?>/gi, "
    99").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&"));
    10 
     10}}}
    1111It appears to me that the true and false statements are in reverse order.  The replacement characters occur if this.renderAsHtml == false when I believe the intent was to replace them if renderAsHtml is set to true.  This causes textareas to destroy data in textareas wrapped in InlineEditBoxes, as well as display them improperly.