首页 文章

<h:inputText>在表单中呈现问题

提问于
浏览
0

我有一个关于渲染一个简单的 <h:inputText> 值的问题 . 当我写作

<h:inputText id="username" value="#{userBean.user.username}" />

它的输出是

<input id="form:username" name="form:username" type="text" />

有没有像这样的输出没有 form:xxx 的方法?

<input id="username" name="username" type="text" />

此外,minlength不适用于 <h:inputText> . 如果没有为表格中的每个数据编写javascript,你有什么想法吗?

1 回答

  • 2

    是的,这是可能的 . 您应该在h:form中添加 prependId 属性

    <h:form prependId="false" id="form1">
    Now everything won't have prefix form1
    </h:form>
    

相关问题