You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Jun 2009
    Location
    New York City
    Posts
    29
    Vote Rating
    0
    agfk is on a distinguished road

      0  

    Default [FIXED-87] [3.0RC3] HTMLEditor prepends ? to message

    After upgrading from 3.0RC1.1 to RC3, I noticed that the HTML editor now prepends a question mark to its output.

    Code:
    var window = Ext.getCmp('message-send-window-for-' + record.data.sessionId);
    if (!window) {
      window = new Ext.Window({
        id: 'message-send-window-for-' + record.data.sessionId,
        title: 'Send message to ' + record.data.userId,
        width: 550,
        height: 350,
        minWidth: 400,
        minHeight: 350,
        layout: 'fit',
        plain: true,
        bodyStyle: 'padding:5px;',
        buttonAlign: 'center',
        items: [
          {
            id: 'message-send-form-for-' + record.data.sessionId,
            xtype: 'form',
            cls: 'x-plain',
            layout: 'fit',
            items:
              {
                xtype: 'htmleditor',
                name: 'message'
              }
          }
        ],
        buttons: [
             {
               text: 'Send',
               handler: function() {
                 var formPanel = Ext.getCmp('message-send-form-for-' + record.data.sessionId);
                 formPanel.getForm().submit({
                   url: Servlets.messageServlet + '?q=post',
                   params: {sessionId: record.data.sessionId},
                   waitMsg: 'Sending',
                   success: function() {
                     Ext.MessageBox.alert('Confirm', 'Message sent');
                     window.hide();
                   },
                   failure: function() {
                     Ext.MessageBox.alert('Error', 'Message was not sent');
                   }
                 });
               }
             }
           ]
        });
     }
     window.show();
    After typing "Hello" into the editor window and hitting "Send", the servlet receives

    Code:
    q -> post
    sessionId -> 367d5247016ff06a8efaedfc6b48
    message -> ?Hello
    Is it a bug or am I missing something here?

    Thanks,

    --Al

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,690
    Vote Rating
    768
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default

    Which browsers have you tested this in?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    105
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default

    That is probably the &​#8203;​ character that is used in an empty HtmlEditor.

    (it is shown as a question mark in a character encoding that doesn't support it)

  4. #4
    Sencha User
    Join Date
    Jun 2009
    Location
    New York City
    Posts
    29
    Vote Rating
    0
    agfk is on a distinguished road

      0  

    Default

    Quote Originally Posted by evant View Post
    Which browsers have you tested this in?
    Chrome and Safari4. I think Firefox does it too. Haven't tried IE.

  5. #5
    Sencha User
    Join Date
    Jun 2009
    Location
    New York City
    Posts
    29
    Vote Rating
    0
    agfk is on a distinguished road

      0  

    Default

    Quote Originally Posted by Condor View Post
    That is probably the &​#8203;​ character that is used in an empty HtmlEditor.

    (it is shown as a question mark in a character encoding that doesn't support it)
    Yeah, I figured as much, but shouldn't this character go away when the editor is *not* empty?

  6. #6
    Sencha User MD's Avatar
    Join Date
    Mar 2007
    Posts
    178
    Vote Rating
    0
    MD is on a distinguished road

      0  

    Default

    Yes, and even if the editor *is* empty, it shouldn't be passed as the underlying value for the field. The sole purpose of this zero-width character (previously a space was used) is to cause the cursor to show up in FF.

    Quote Originally Posted by agfk View Post
    Yeah, I figured as much, but shouldn't this character go away when the editor is *not* empty?

  7. #7
    Sencha User mono blaine's Avatar
    Join Date
    Jul 2008
    Location
    Turkey
    Posts
    123
    Vote Rating
    8
    mono blaine will become famous soon enough

      0  

    Default

    I have encountered this problem, too. If you press backspace befeore typing any letter, the question mark is not prepended. In other cases, it does. Initially setting the field to '' using setValue or setRawValue does not work, either.

  8. #8
    Sencha User
    Join Date
    Jun 2009
    Location
    New York City
    Posts
    29
    Vote Rating
    0
    agfk is on a distinguished road

      0  

    Default

    The problem is the following comparison in cleanHtml():

    Code:
            if(html == this.defaultValue){
                html = '';
            }
    The comparison always returns false because this.defaultValue contains the 7-character string

    Code:
    ​​'&​​​#8203;'
    whereas html contains the actual zero-width space character.

  9. #9
    Sencha User
    Join Date
    Jun 2009
    Location
    New York City
    Posts
    29
    Vote Rating
    0
    agfk is on a distinguished road

      0  

    Default

    Bump.

  10. #10
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,690
    Vote Rating
    768
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default

    Confirmed, we'll look into it.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!