我正在使用 JSF 2.0.4 一个表单下有一个组件,其中有一个f:ajax
<h:form id="formid"....>
......
<h:outputText id="textid" ........../>
.........
<h:commandLink id=".." value="...">
<f:ajax event="click" render="formid" execute="input" listener="#{bean.action}"/>
<h:commandLink/>
<h:form/>
渲染属性是否有任何表达式可以从formid中排除textid,以便在ajax触发后渲染表单而不是outputText?
最佳答案
我不知道有什么方法可以指定“表单中除此之外的所有内容”,但是您可以不使用表单 id 作为渲染关键字,而只列出要渲染的表单下的子 id,而不是包括输出文本的 id,即类似
<f:ajax event="click" render="id1 id2 id3" execute="input" listener="#{bean.action"/>
我不确定你为什么想要这个 - 如果你不希望在 ajax 事件触发时更新输出文本,我认为你所要做的就是不在监听器中更新它?
关于ajax - jsf ajax部分渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8465622/