Announcement Announcement Module
Collapse
No announcement yet.
Strange behaviour clientNumberValidator and convertNumber in ru locale Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange behaviour clientNumberValidator and convertNumber in ru locale

    Good day,

    Have some strange behaviour in my JSF-WebFlow application:

    Code:
    <sf:clientNumberValidator>
    	<h:inputText id="value" value="#{testParams.value}" required="false">
    		<f:convertNumber type="number" pattern="#,##0.00"/>
    	</h:inputText>
    </sf:clientNumberValidator>
    where testParams.value - double.

    In russian locale fractional delimiter is comma (","). When i send some value to server (for example 1.3) in model i see only integer part (1), fractional part is lost. requestParameters.get("testParams:value") have value "1.3", with dot delimiter. Validation in this case work and initial display value is normal (i see delimited value 0,00 in may case and can enter any valid value but after submit form and send to server i lost fraction part).

    If i remove "<sf:clientNumberValidator>", i lost validation on this field but can send any value (1,3 - with comma) and this value will be parsed ok - with fractional part. Initial value in field is also ok - 0,00. But i lost validation, so is not so good.

    I tried remove "<f:convertNumber/>" instead validator. Values passed to field on submit parsed ok, but initial values is not formated (i see "0.0" in text box, what is not valid in my case, because delimiter is "," and field is marked with error and not allow submit form). If i come to field and go out value will be reformated in correct way (0,0).

    My question - how i can use this two tags (clientNumberValidator and convertNumber) together? I think that there is something wrong with locales but can't find bug.

  • #2
    Help!

    Is there anybody who can help me?

    Comment

    Working...
    X