【问题标题】:add rows in rich:datatable without erasing the typed lines在 rich:datatable 中添加行而不擦除键入的行
【发布时间】:2017-12-21 19:28:42
【问题描述】:

早安! 我正在使用丰富的:extendedDataTable (JSF 1.2) 并添加行,但是当我添加新行时,我在其他行中键入的信息将被删除。 不知道有没有什么办法可以只添加行而不删除我填写的数据?

下面的代码

<a4j:commandButton value="Adicionar" reRender="gridList" action="#{managed$EvpessSessionBean.addPessoas}" ajaxSingle="true"/>

<rich:extendedDataTable height="480px" id="gridList" rows="15" selectionMode="single" value="#{managed$EvpessSessionBean.pessoasLista}" var="listPessoas" width="890px" >

<rich:column label="Codigo" width="50px">
<f:facet name="header">
<h:outputText value="Codigo"/>
</f:facet>
<h:outputText value="#{listPessoas.codpessoa}" />
</rich:column>

<rich:column label="Nome" width="290px">
<f:facet name="header">
<h:outputText value="Nome"/>
</f:facet>
<h:inputText value="#{listPessoas.nome}" style="width: 100%" onkeyup="this.value = this.value.toUpperCase();"/>

</rich:extendedDataTable>
<rich:datascroller align="center" for="gridList" id="sc2" maxPages="20"/>

添加按钮执行以下操作...

private List<Evpess> pessoasLista;

//Getter e Setter de pessoasLista...

public void addPessoas() {        
 Evpess p = new Evpess();        
 p.setCadacodigo(new Uccada());
 p.setCodmovisocial(new Evmoso());
 p.setEmprcod(new Eoempr(1));
 pessoasLista.add(p);            
}

【问题讨论】:

    标签: jsf richfaces


    【解决方案1】:

    您需要将 dataTable 内容提交到托管 bean,以便保留这些值。 将execute="gridList" 添加到您的a4j:commandButton

    【讨论】:

      猜你喜欢
      • 2013-05-24
      • 2011-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-11
      • 1970-01-01
      相关资源
      最近更新 更多