Community
Participate
Working Groups
Contacts sample, spaces in the name proprerty should be preserved. 1. Type "Name " into the name field with a space at the end. 2. Go to source and see the generated code: <c:contact name="Name "> 3. Go back to the design view and notice that the space has been removed from the text field.
There are several problems... 1. The behavior on read and write is inconsistent. Write always preserves entered whitespace. Read applies normalization. Any normalization should be consistently applied on read and on write. 2. There is no API to opt-out from trim normalization. 3. All parts of the system are not on the same page regarding what normalization to use. This lead to the following very annoying problem: A. Type some text into any form text field backed by XML data. B. Quickly type a few more letters followed by a a space or two. C. The cursor jumps to the start of text and trailing spaces are removed. The desired behavior is to preserve text as typed into a text field during the course of the editing session, regardless of normalization behavior. This means that presentation level code that binds UI controls to model needs to be able to compare values in their normalized form. We lack API for this. 4. The API that we do have for specifying whitespace handling is at the wrong API level... @XmlValueBinding( path = "description", collapseWhitespace = true )... The problem is that whitespace normalization is not limited to XML data storage and the parts of the system that need to interact with normalization aren't aware of how model data is stored.
Introduced new @Whitespace annotation along with ValueNormalizationService API. See content in the what's new and migration docs for more detail. Make sure to re-build the dev environment as this fix required changes to the annotation processor.
Fixed. Please verify. There is new value/whitespace section in the gallery sample.
verified on 0.3.0.201105261624 with gallery sample
Closing.