[richfaces-issues] [JBoss JIRA] (RF-12764) rich:select - javascript error when using myfaces with french locale

Dupont Dupont (JIRA) jira-events at lists.jboss.org
Mon Jan 28 08:13:47 EST 2013


Dupont Dupont created RF-12764:
----------------------------------

             Summary: rich:select - javascript error when using myfaces with french locale
                 Key: RF-12764
                 URL: https://issues.jboss.org/browse/RF-12764
             Project: RichFaces
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
            Reporter: Dupont Dupont


Using RF 4.3.0.CR2, using rich:select with french locale on Myfaces produces the following javascript error :

{code}
Uncaught SyntaxError: Unexpected identifier.
{code}

It appears when javax.faces.component.UISelectOne.INVALID error message has a value containing a single quote.

To reproduce it, just add the following line in your jsf messages properties :

{code}
javax.faces.component.UISelectOne.INVALID = {0} : Erreur de validation : la valeur n''est pas valide.
{code}

And add a rich:select in your JSF page.

This error impacts users of Websphere 8 (tested on 8.0.0.3) with french locale (myfaces provides a default message containing simple quotes).

Resolved locally by modifying AddCSVMessageScript#appendcript
But perhaps I've missed some side effects.

{code:java}
    @Override
    public void appendScript(Appendable target) throws IOException {

        String summary = facesMessage.getSummary();
        String detail = facesMessage.getDetail();
        int severity = facesMessage.getSeverity().getOrdinal();
        StringBuilder builder = new StringBuilder();
        ScriptUtils.appendEncodedString(builder, summary);
        summary = builder.toString();
        builder = new StringBuilder();
        ScriptUtils.appendEncodedString(builder, detail);
        detail = builder.toString();
        
        String script = MessageFormat.format(MESSAGE_OBJECT, messageId, summary, detail, severity);
        target.append(script);
    }
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list