我一直在谷歌搜索这个问题,但我似乎没有找到解决方案。我想知道是否有任何开发人员能够实现这一目标?我知道有几个适用于 JSF 的 ajax 框架,例如 Richfaces、primefaces、icefaces……我看过他们的展示,但似乎找不到我想要的东西。
问问题
2747 次
2 回答
3
h:dataTable
假设我们总是追加到表中,这就是它的工作原理:
<h:form>
<h:panelGroup id="animatedTableGroup">
<h:dataTable id="animatedTable" value="#{myBean.rows}" var="row">
<h:column>
<h:outputText value="#{row}"/>
</h:column>
</h:dataTable>
<rich:jQuery timing="onload"
selector="#animatedTable tr:last" query="fadeOut('slow')"/>
<rich:jQuery timing="onload"
selector="#animatedTable tr:last" query="fadeIn('slow')"/>
</h:panelGroup>
<a4j:commandButton value="Add row"
action="#{myBean.addRow}" reRender="animatedTableGroup"/>
</h:form>
还有豆子:
public void addRow() {
rows.add(new Date().toString());
}
public List<String> getRows() {
return rows;
}
如果你想插入到表格中的选定位置,那么最好使用rich:extendedDataTable
和使用这样的东西作为选择器:
<rich:jQuery timing="onload"
selector="#animatedTable tr.rich-sdt-row-selected" query="..."/>
于 2010-09-22T02:50:35.483 回答
1
Richfaces原生支持使用组件的jQuery 。rich:jQuery
您可以使用jQuery支持的任何效果。例如:
<h:commandButton id="submitButton" value="Submit"
action="#{myBean.myAction}" style="display: none;"/>
<rich:jQuery selector="#submitButton"
query="fadeIn('slow')" timing="onload">
或者
<h:commandButton id="submitButton" value="Submit"
action="#{myBean.myAction}"
onmouseover="jQuery(this).fadeOut('slow');"
onmouseout="jQuery(this).fadeIn('slow')"/>
您可以在此处找到更多示例:http: //docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_jQuery.html
于 2010-09-22T00:39:13.140 回答