JSF Trinidad tr:inputText trimming

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 06:40:08

问题


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 came 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.


回答1:


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



来源:https://stackoverflow.com/questions/5636360/jsf-trinidad-trinputtext-trimming

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!