开发者

JSF Trinidad tr:inputText trimming

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜