JSF 杂项

来源:互联网 发布:换身网络电影 编辑:程序博客网 时间:2024/05/14 01:54

h:comandButton action执行之后刷新整个页面。

a4j:commandButton action执行之后,只刷新reRender中指明的。

commandLink 也是这样的。如果不想刷新整个页面,就应该用a4j:commandXXX

 

 

h:commandButton 在localhost 测试用到 a4j:support 时, 需要多点击一次(点击页面任何位置)才可以提交订单。

而发布到服务器,没有这个问题。

 

=========================================

用于再h:table 中得到行号

 

在Bean中:

private UIData table;

    public UIData getTable() {
        return table;
    }

    public void setTable(UIData table) {
        this.table = table;
    }

 

JSP中:

<rich:dataTable id="id_searchResultTable" value="#{SearchHandler.resultList}" var="service" binding="#{SearchHandler.table}"
            rows="#{SearchHandler.rows}" first="#{SearchHandler.first}"
            style="width : 600px; border-style: none ; ">

    <rich:column colspan="2" style="border-style: none ;">

             <span class="sn"><h:outputText value="#{SearchHandler.table.rowIndex+1}"/></span>

             ......

 

 

==============================================

 慎用binding在rich:datatable中  binding="#{OrderHandler.table}"

 

    private UIDataTable table;
    public UIDataTable getTable() {
        return table;
    }
    public void setTable(UIDataTable table) {
        this.table = table;
    }

 

    这样会引起当F5刷新一次页面后,数据发生变化、而页面呈现不更新的问题。

  (本来这句话也没有用处。不刷新,工作正常,原因还不知道。)

 

 

JSF 标签中的rendered如果为false。 这次标签不会被生产view的tree中,这样当rendered为true后,对该标签的改动也不会被更新于ManagedBean中。  解决的办法: 控制标签的style,style="#{workerItem.editable?'':'display:none'}"