错误“”包含未知 ID”当用于渲染时
这是我的形式:
<h:body>
<h:form>
<h:panelGrid columns="3" >
<h:outputLabel for="name" value="Primeiro nome:" />
<h:inputText id="name" value="#{register.person.name}" >
<f:ajax event="blur" render="m_name" listener="#{register.validateName}" />
</h:inputText>
<rich:message id="m_name" for="name" />
//.. others fields
</h:panelGrid>
</h:form>
</body>
当我尝试在 Glassfish 上执行时出现以下错误:
javax.servlet.ServletException: <f:ajax> contains an unknown id 'm_name' - cannot locate it in the context of the component name
但是如果我将
更改为
它有效(我希望它与 rich:message 一起使用,因为它返回图像和消息)
为什么会发生这种情况?以前从来没有发生在我身上,直到现在。
This is my form:
<h:body>
<h:form>
<h:panelGrid columns="3" >
<h:outputLabel for="name" value="Primeiro nome:" />
<h:inputText id="name" value="#{register.person.name}" >
<f:ajax event="blur" render="m_name" listener="#{register.validateName}" />
</h:inputText>
<rich:message id="m_name" for="name" />
//.. others fields
</h:panelGrid>
</h:form>
</body>
When i try to execute on Glassfish gives the follow error :
javax.servlet.ServletException: <f:ajax> contains an unknown id 'm_name' - cannot locate it in the context of the component name
But if i change <rich:message ..>
by <h:message..>
it works (I want it works with rich:message because it returns an image and a message )
Why this is happening ? Never happened with me before, until now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
RichFaces 组件参考 讲述这关于
<丰富:消息>
:因此,我只需删除
m_name
上的render
属性,并将
替换为;
。如果您仍想显式指定它,可以在
组件上设置ajaxRendered="false"
。The RichFaces component reference tells this about the
<rich:messages>
:So, I'd just remove the
render
attribute onm_name
and replace<f:ajax>
by<a4j:ajax>
.If you want to explicitly specify it anyway, you can set
ajaxRendered="false"
on the<rich:message>
component.对我来说,这看起来像是富人的行为。我怀疑您必须提交错误报告。
解决方法是将 rich:message 标记包含在 div 标记内的 rich:message 标记内,然后为 div 标记指定 id="m_name"。
Looks like a richfaces behavior to me. I suspect you will have to file a bug report.
A work-around is to enclose the rich:message tag inside a rich:message tag inside a div tag, then give the div tag an id="m_name".