Jsf 2 <;f:ajax>;包含未知id:someid(在<;中使用时);用户界面:重复>;
我的代码片段:Jsf 2 <;f:ajax>;包含未知id:someid(在<;中使用时);用户界面:重复>;,jsf-2,Jsf 2,我的代码片段: <ui:repeat var="o"> <h:panelGroup id="someid"> <ui:repeat> // HTML </ui:repeat> </h:panelGroup> <div> <h:form> <h:commandButton action="#{o.doSomethin
<ui:repeat var="o">
<h:panelGroup id="someid">
<ui:repeat>
// HTML
</ui:repeat>
</h:panelGroup>
<div>
<h:form>
<h:commandButton action="#{o.doSomething}">
<f:ajax event="action" render=":someid" />
</h:commandButton>
<h:form>
</div>
</ui:repeat>
//HTML
为什么
没有找到某个ID
?这是不可能的。
在客户端ID前面加上自己的ID和索引。所有这些面板组都会获得ID,比如j_id1:0:someid
,j_id1:1:someid
,j_id1:2:someid
,等等。以下内容应该在您的特定构造中起作用:
<f:ajax render=":#{component.parent.parent.clientId}:someid" />
谢谢但我想呈现整个外部ui:重复。那么,我该怎么做呢?哦?你在问题中没有说清楚。只需将外部
放在
中,并使用render=“:foo”
(或者无论其实际客户端ID是什么,右键单击浏览器中的页面并查看源代码即可找到它)。
<ui:repeat var="o">
<h:form>
<h:panelGroup id="someid">
<ui:repeat>
// HTML
</ui:repeat>
</h:panelGroup>
<div>
<h:commandButton action="#{o.doSomething}">
<f:ajax event="action" render="someid" />
</h:commandButton>
</div>
<h:form>
</ui:repeat>