Sve*_*ven 11 ajax jsf jsf-2 uirepeat
我已经实现了由转发器创建的列表:
<ui:repeat value="#{projectData.paginator.list}" var="project">
<h:outputText value="#{project.title}" />
</ui:repeat>
Run Code Online (Sandbox Code Playgroud)
和一个过滤我的列表的按钮:
<h:commandLink action="#{overviewController.filterNew}">
<h:outputText value="Filter List" />
</h:commandLink>
Run Code Online (Sandbox Code Playgroud)
那么,点击命令链接(使用AJAX)后,是否有一种简单的方法只渲染我的转发器:-)
我试过以下:
<f:ajax render="repeater">
ui:repeat id="repeater" value="#{projectData.paginator.list}" var="project">
<h:outputText value="#{project.title}" />
</ui:repeat>
<f:ajax />
<h:commandLink action="#{overviewController.filterNew}">
<h:outputText value="Filter List" />
<f:ajax event="click" render="repeater"/>
</h:commandLink>
Run Code Online (Sandbox Code Playgroud)
但那没用..
<h:form>
ui:repeat id="repeater" value="#{projectData.paginator.list}" var="project">
<h:outputText value="#{project.title}" />
</ui:repeat>
<h:commandLink action="#{overviewController.filterNew}">
<h:outputText value="Filter List" />
<f:ajax event="click" render="repeater"/>
</h:commandLink>
</h:form>
Run Code Online (Sandbox Code Playgroud)
也不起作用...也许我有把动作方法(overviewController.filterNew)放入ajax标签?
<f:ajax event="click" render="repeater">
<h:commandLink action="#{overviewController.filterEBus}">
<h:outputText value="EBusiness" />
</h:commandLink>
</f:ajax>
Run Code Online (Sandbox Code Playgroud)
也不起作用!
也许不可能重新报复中继器?是否有另一个元素,如div标签或可以重新呈现的东西???
...
谢谢您的帮助
Bal*_*usC 27
它<ui:repeat>本身不会为输出生成任何HTML.所述<f:ajax render>期望的ID,其是存在于HTML DOM树.把它放在a中<h:panelGroup>,id然后引用它.
<h:form>
<h:panelGroup id="projects">
<ui:repeat value="#{projectData.paginator.list}" var="project">
<h:outputText value="#{project.title}" />
</ui:repeat>
</h:panelGroup>
<h:commandLink action="#{overviewController.filterNew}">
<h:outputText value="Filter List" />
<f:ajax execute="@form" render="projects" />
</h:commandLink>
</h:form>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20139 次 |
| 最近记录: |