Problem with strings containing tilde (~) in outputText and inputText
Hi,
Our application has a form with some text input fields that need to allow a tilde ('~') character. When the form is submitted, strings that contain a ~ are saved correctly to the database. However, when the data is displayed again, either in an outputText component (for viewing) or an inputText component (for editing) everything after the ~ is not displayed. It seems to be something inside these JSF components which is not handling ~ correctly. Anyone else have this problem?
Thanks,
Ellen
# 3
Hello,
Have you found any solution for the problem described in this thread?
I'm facing with the same problem, but in an other context. I'm using JSF with AJAX4JSF component library. The problem occurs when the user enters a tilde (~) character into an h:inputText, submits the form, and the AJAX4JSF rerenders the region which contains the h:inputText.
My JSF page contains this:
<h:inputText id="searchFor" value="#{searchHandler.searchFor}" onkeydown="handleSearchKeyDown(event)"/>
If a type the word "data" into the input field, and submit the form, the rerendered HTML part looks correct:
<input type="text" id="minerva:searchFor" name="minerva:searchFor" value="data" onkeydown="handleSearchKeyDown(event)"/>
But if I type the word "data~" into the input field, and submit the form, the rerendered HTML part looks broken:
<input type="text" id="minerva:searchFor" name="minerva:searchFor" value="dataent)"/>
As you see, the tilde character totally killed the onkeydown attribute.
I've revised the AJAX4JSF source code, I could not find anything which was around the tilde character, that's why I think too that it's a core JSF problem.
Do you have any idea, what happens here?
Many thanks in advance,
Peter.
# 4
This is fixed in the latest builds of the JSF RI.
The latest build is 1.2_04 P01. In the same folder from which
you can download the zip is an updater which you can use
to upgrade your existing GlassFish installation.
https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=7089&expandFolder=7089&folderID=0