开发者

JSF Trinidad tr:inputText trimming

开发者 https://www.devze.com 2023-02-25 13:25 出处:网络
When user inserts white spaces in input generated by tr:inputText and submits form I get the value that was submitted in JSF converter (my converter does no trimming) set on the input. But I get null

When user inserts white spaces in input generated by tr:inputText and submits form I get the value that was submitted in JSF converter (my converter does no trimming) set on the input. But I get null value (original value that c开发者_运维知识库ame to the input) to managed bean.

JSF page:

<tr:inputText label="..."
  value="#{ManagedBean.object.defaultValue}" id="defValueId"
  converter="#{MyConverter}">
  <tr:validateLength maximum="255"/>
  <f:attribute name="domainId" value="domainId"/>
</tr:inputText>

When I use h:inputText, I get the value that was submitted to my managed bean.

Why and where does Trinidad ignores whitespaces? Can I change anything so it works as for h:inputText.

Note: I use JSF 1.2 and Trinidad 1.2.13. I am not solving here problem empty string to null.


Within JSF Expression Language (EL), we could use JSF Expression Language functions in addition. The Expression Language supported by Facelets is called Unified Expression Language. Therefore, if we want to invoke a the trim function in a inputText:

<h:inputText value="#{trim[ramdomText]}"/>

Further info: http://java.sun.com/products/jsp/reference/techart/unifiedEL.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号