[ADF]Table barra de rolagem

Recente mente tive problema de barra de rolagem, na horizontal. Tabela tinha vários colunas, maior que atela, o mesmo acontecia com as linhas.

Problema: Qdo eu fazia consulta , e tinha linhas superior que a tela. O scroll (barra de rolagem), não aparecia. Pq a barra de rolagem estava exatamente na última linha, ou seja a barra acompanhava a última linha.

Solução foi colocar scroll:

  styleClass="AFStretchWidth"
  inlineStyle="overflow:auto;"

O Projeto, de uma olhada

<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
  <f:view locale="pt-BR">
    <af:document id="d1" title="Embratel - Portal">
      <af:form id="f1">
        <af:pageTemplate value="#{bindings.pageTemplateBinding.templateModel}" id="pt1">
          <f:facet name="content">
            <af:group id="g1">
              <af:panelGroupLayout id="pgl2"
                                   binding="#{MovimentoBancoBean.pglMaster}"
                                   partialTriggers="t1:gl1 cb21" visible="true">
                <af:panelAccordion id="pa1" styleClass="AFStretchWidth"
                                   dimensionsFrom="children"
                                   discloseMany="true">
                  <af:showDetailItem text="Pesquisar - Movimento Banco"
                                     id="sdi1" disclosed="true">
                    <af:panelFormLayout id="pfl1">
                      <af:selectOneChoice label="Banco:" id="soc1"
                                          value="#{bindings.banco1.inputValue}"
                                          unselectedLabel="Todos">
                        <af:forEach items="#{bindings.BancoView1.rangeSet}"
                                    var="bc">
                          <af:selectItem label="#{bc.CodBanco} - #{bc.NmeBanco}"
                                         value="#{bc.CodBanco}" id="si2"/>
                        </af:forEach>
                      </af:selectOneChoice>
                      <af:selectOneChoice label="Companhia:" id="soc2"
                                          value="#{bindings.companhia1.inputValue}"
                                          unselectedLabel="Todos">
                        <af:forEach items="#{bindings.CompanhiaView1.rangeSet}"
                                    var="bc">
                          <af:selectItem label="#{bc.NmeCia}"
                                         value="#{bc.CodCia}" id="si3"/>
                        </af:forEach>
                      </af:selectOneChoice>
                      <af:selectOneChoice label="Status:" id="soc3"
                                          value="#{bindings.status1.inputValue}"
                                          unselectedLabel="Todos">
                        <af:forEach items="#{bindings.StatusConciliadoView1.rangeSet}"
                                    var="bc">
                          <af:selectItem label="#{bc.DscStaConciliado}"
                                         value="#{bc.StaConciliado}" id="si1"/>
                        </af:forEach>
                      </af:selectOneChoice>
                      <af:inputText label="Convênio:" id="it1"
                                    value="#{bindings.convenio1.inputValue}"/>
                      <af:inputDate id="id1"
                                    value="#{bindings.dtaInicial1.inputValue}"
                                    label="Data Inicial:" showRequired="true"
                                    binding="#{MovimentoBancoBean.dtaInicio}"/>
                      <af:inputDate id="id2"
                                    value="#{bindings.dtaFinal1.inputValue}"
                                    label="Data Final:" showRequired="true"
                                    binding="#{MovimentoBancoBean.dtaFim}"/>
                      <af:panelGroupLayout id="pgl4" layout="horizontal">
                        <af:commandButton disabled="#{!bindings.ExecuteWithParams.enabled}"
                                          id="cb2" text="Pesquisar"
                                          actionListener="#{MovimentoBancoBean.pesquisar}"/>
                      </af:panelGroupLayout>
                    </af:panelFormLayout>
                  </af:showDetailItem>
                  <af:showDetailItem text="Resultado" id="sdi2" disclosed="true"
                                     rendered="#{not empty bindings.dtaInicial1.inputValue and not empty bindings.dtaFinal1.inputValue}">
                    <af:table value="#{bindings.VMovimentoBancoView1.collectionModel}"
                              var="row"
                              rows="#{bindings.VMovimentoBancoView1.rangeSize}"
                              emptyText="#{bindings.VMovimentoBancoView1.viewable ? 'Não há dados para exibir.' : 'Access Denied.'}"
                              fetchSize="#{bindings.VMovimentoBancoView1.rangeSize}"
                              rowBandingInterval="0"
                              selectedRowKeys="#{bindings.VMovimentoBancoView1.collectionModel.selectedRow}"
                              selectionListener="#{bindings.VMovimentoBancoView1.collectionModel.makeCurrent}"
                              rowSelection="single" id="t1"
                              partialTriggers="::cb2  ::cb21"
                              styleClass="AFStretchWidth"
                              inlineStyle="overflow:auto;"
                              autoHeightRows="#{bindings.VMovimentoBancoView1.rangeSize}">
                      <af:column sortProperty="CodBanco" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.CodBanco.label}"
                                 id="c18" align="center">
                        <af:outputText value="#{row.CodBanco}" id="ot12" shortDesc="#{row.NmeBanco}"/>
                      </af:column>
                      <af:column sortProperty="CodCia" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.CodCia.label}"
                                 id="c12" align="center">
                        <af:outputText value="#{row.CodCia}" id="ot5" shortDesc="#{row.NmeCia}"/>
                      </af:column>
                      <af:column sortProperty="DtaPagto" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.DtaPagto.label}"
                                 id="c1" align="center">
                        <af:outputText value="#{row.DtaPagto}" id="ot1">
                          <af:convertDateTime pattern="#{bindings.VMovimentoBancoView1.hints.DtaPagto.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="VlrBruto" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.VlrBruto.label}"
                                 id="c10" align="center">
                        <af:outputText value="#{row.VlrBruto}" id="ot21"
                                       inlineStyle="float:right">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.VMovimentoBancoView1.hints.VlrBruto.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="VlrTarifa" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.VlrTarifa.label}"
                                 id="c6" align="center">
                        <af:outputText value="#{row.VlrTarifa}" id="ot6"
                                       inlineStyle="float:right">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.VMovimentoBancoView1.hints.VlrTarifa.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="VlrTarifaEsperada"
                                 sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.VlrTarifaEsperada.label}"
                                 id="c15" align="center">
                        <af:outputText value="#{row.VlrTarifaEsperada}"
                                       id="ot25" inlineStyle="float:right">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.VMovimentoBancoView1.hints.VlrTarifaEsperada.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="QtdMov" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.QtdMov.label}"
                                 id="c14" align="center">
                        <af:outputText value="#{row.QtdMov}" id="ot22">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.VMovimentoBancoView1.hints.QtdMov.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="VlrTarifaPadrao" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.VlrTarifaPadrao.label}"
                                 id="c3" align="center">
                        <af:outputText value="#{row.VlrTarifaPadrao}" id="ot19"
                                       inlineStyle="float:right">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.VMovimentoBancoView1.hints.VlrTarifaPadrao.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="DscStaConciliado" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.DscStaConciliado.label}"
                                 id="c9" align="center">
                        <af:commandLink id="gl1"
                                        partialSubmit="true"
                                        visible="#{row.StaConciliado != 'N' and row.StaConciliado != 'D'}"
                                        actionListener="#{MovimentoBancoBean.buscaCodGrupo}"
                                        action="#{MovimentoBancoBean.resumoConciliacao}"
                                        text="#{row.DscStaConciliado}">
                          <af:clientAttribute name="codGrupoConc"
                                              value="#{row.CodGrupoContabilConc}"/>
                        </af:commandLink>
                        <af:outputText value="#{row.DscStaConciliado}" id="ot17"
                                       visible="#{row.StaConciliado == 'N' or row.StaConciliado == 'D'}"/>
                      </af:column>
                      <af:column sortProperty="TpoArrec" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.TpoArrec.label}"
                                 id="c25" align="center">
                        <af:outputText value="#{row.TpoArrec}" id="ot7"/>
                      </af:column>
                      <af:column sortProperty="CodConvenio" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.CodConvenio.label}"
                                 id="c24" align="center">
                        <af:outputText value="#{row.CodConvenio}" id="ot8" shortDesc="#{row.FilePath}/#{row.FileName}"/>
                      </af:column>
                      <af:column sortProperty="CodModalidade" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.CodModalidade.label}"
                                 id="c7" align="center">
                        <af:outputText value="#{row.CodModalidade}" id="ot10"/>
                      </af:column>
                      <af:column sortProperty="DtaArquivo" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.DtaArquivo.label}"
                                 id="c16" align="center">
                        <af:outputText value="#{row.DtaArquivo}" id="ot2">
                          <af:convertDateTime pattern="#{bindings.VMovimentoBancoView1.hints.DtaArquivo.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="CodBancoAnt" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.CodBancoAnt.label}"
                                 id="c8" align="center">
                        <af:outputText value="#{row.CodBancoAnt}" id="ot24"/>
                      </af:column>
                      <af:column sortProperty="CodGrupoContabilConc"
                                 sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.CodGrupoContabilConc.label}"
                                 id="c19" align="center">
                        <af:outputText value="#{row.CodGrupoContabilConc}"
                                       id="ot9"/>
                      </af:column>
                      <af:column sortProperty="VlrGrupoConciliacao"
                                 sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.VlrGrupoConciliacao.label}"
                                 id="c2" align="center">
                        <af:outputText value="#{row.VlrGrupoConciliacao}"
                                       id="ot16" inlineStyle="float:right">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.VMovimentoBancoView1.hints.VlrGrupoConciliacao.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="DesStepConciliacao"
                                 sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.DesStepConciliacao.label}"
                                 id="c13" align="center">
                        <af:outputText value="#{row.DesStepConciliacao}"
                                       id="ot13"/>
                      </af:column>
                      <af:column sortProperty="NmeUsuario" sortable="true"
                                 headerText="#{bindings.VMovimentoBancoView1.hints.NmeUsuario.label}"
                                 id="c17" align="center">
                        <af:outputText value="#{row.NmeUsuario}" id="ot3"/>
                      </af:column>
                    </af:table>
                    <f:facet name="toolbar">
                      <af:toolbar id="t2">
                       <af:commandButton text="Exportar" id="cb1"
                                        iconPosition="trailing"
                                        inlineStyle="text-align:left;"
                                        partialSubmit="true">
                           <af:fileDownloadActionListener filename="ASConciliacao_MovimentoBanco.xls"
                                                       method="#{MovimentoBancoBean.exportarTabela}"/>
                      
                      
                      
                       <!-- <af:commandButton text="Exportar"
                                          iconPosition="trailing"
                                          partialTriggers="cb1 t1"
                                          disabled="#{bindings.VMovimentoBancoView1Iterator.estimatedRowCount eq 0}"
                                          id="cb1">
                          <af:exportCollectionActionListener exportedId="t1"
                                                             type="excelHTML"
                                                             filename="ASConciliacao_MovimentoBanco.xls"
                                                             title="Exportar"/>-->
                        </af:commandButton>
                      </af:toolbar>
                    </f:facet>
                  </af:showDetailItem>
                </af:panelAccordion>
              </af:panelGroupLayout>
              <af:panelGroupLayout id="pgl1"
                                   binding="#{MovimentoBancoBean.pglDetail}"
                                   visible="false" partialTriggers="t1:gl1 cb21">
                <af:panelAccordion id="pa11" styleClass="AFStretchWidth"
                                   dimensionsFrom="children"
                                   discloseMany="true">
                  <af:showDetailItem text="Resultado - Movimento Banco"
                                     id="sdi11" disclosed="true">
                    <af:table value="#{bindings.VRetornoSintView1.collectionModel}"
                              var="row"
                              rows="#{bindings.VRetornoSintView1.rangeSize}"
                              emptyText="#{bindings.VRetornoSintView1.viewable ? 'Não há registros para exibir.' : 'Access Denied.'}"
                              fetchSize="#{bindings.VRetornoSintView1.rangeSize}"
                              rowBandingInterval="0" id="t21"
                              styleClass="AFStretchWidth"
                              inlineStyle="height:auto;" autoHeightRows="15">
                      <af:column sortProperty="CodBanco" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.CodBanco.label}"
                                 id="c84" align="center">
                        <af:outputText value="#{row.CodBanco}" id="ot65"
                                       noWrap="false"
                                       shortDesc="#{row.NmeBanco}"/>
                      </af:column>
                      <af:column sortProperty="CodCia" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.CodCia.label}"
                                 id="c88" align="center">
                        <af:outputText value="#{row.CodCia}" id="ot36"
                                       noWrap="false"
                                       shortDesc="#{row.NmeCia}"/>
                      </af:column>
                      <af:column sortProperty="DtaPagto" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.DtaPagto.label}"
                                 id="c86" align="center">
                        <af:outputText value="#{row.DtaPagto}" id="ot70">
                          <af:convertDateTime pattern="#{bindings.VRetornoSintView1.hints.DtaPagto.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="VlrBruto" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.VlrBruto.label}"
                                 id="c62" align="center">
                        <af:outputText value="#{row.VlrBruto}" id="ot48"
                                       inlineStyle="float:right"/>
                      </af:column>
                      <af:column sortProperty="VlrTarifa" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.VlrTarifa.label}"
                                 id="c81" align="center">
                        <af:outputText value="#{row.VlrTarifa}" id="ot73"
                                       inlineStyle="float:right"/>
                      </af:column>
                      <af:column sortProperty="VlrTarifaEsperada"
                                 sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.VlrTarifaEsperada.label}"
                                 id="c82" align="center">
                        <af:outputText value="#{row.VlrTarifaEsperada}"
                                       id="ot83" inlineStyle="float:right"/>
                      </af:column>
                      <af:column sortProperty="QtdMov" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.QtdMov.label}"
                                 id="c69" align="center">
                        <af:outputText value="#{row.QtdMov}" id="ot67"
                                       inlineStyle="float:right"/>
                      </af:column>
                      <af:column sortProperty="VlrTarifaPadrao" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.VlrTarifaPadrao.label}"
                                 id="c73" align="center">
                        <af:outputText value="#{row.VlrTarifaPadrao}" id="ot71"
                                       inlineStyle="float:right"/>
                      </af:column>
                      <af:column sortProperty="TpoArrec" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.TpoArrec.label}"
                                 id="c58" align="center">
                        <af:outputText value="#{row.TpoArrec}" id="ot89"/>
                      </af:column>
                      <af:column sortProperty="CodConvenio" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.CodConvenio.label}"
                                 id="c59" align="right">
                        <af:outputText value="#{row.CodConvenio}" id="ot85"
                                       noWrap="false"
                                       shortDesc="#{row.FilePath}/#{row.FileName}"/>
                      </af:column>
                      <af:column sortProperty="CodModalidade" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.CodModalidade.label}"
                                 id="c74" align="center">
                        <af:outputText value="#{row.CodModalidade}" id="ot81"/>
                      </af:column>
                      <af:column sortProperty="DtaArquivo" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.DtaArquivo.label}"
                                 id="c90" align="center">
                        <af:outputText value="#{row.DtaArquivo}" id="ot74">
                          <af:convertDateTime pattern="#{bindings.VRetornoSintView1.hints.DtaArquivo.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="CodBancoAnt" sortable="false"
                                 headerText="#{bindings.VRetornoSintView1.hints.CodBancoAnt.label}"
                                 id="c60" align="center">
                        <af:outputText value="#{row.CodBancoAnt}" id="ot33"
                                       noWrap="false"
                                       shortDesc="#{row.NmeBancoAnt}"/>
                      </af:column>
                    </af:table>
                    <f:facet name="toolbar">
                      <af:toolbar id="t4">
                        <af:commandButton text="Desfazer" id="cb21"
                                          action="#{MovimentoBancoBean.atualizarConciliacao}"
                                          rendered="#{bindings.StaConciliado == 'M' and MovimentoBancoBean.usuarioRule}"
                                          partialSubmit="true"
                                          partialTriggers="t1:gl1" 
                                          actionListener="#{bindings.updateAll.execute}"/>
                        <af:commandButton text="Voltar" id="cb3"
                                          action="#{MovimentoBancoBean.voltarTelaPrincipal}"/>
                      </af:toolbar>
                    </f:facet>
                  </af:showDetailItem>
                  <af:showDetailItem text="Resultado - Movimento Contabil"
                                     id="sdi21" disclosed="true">
                    <af:table value="#{bindings.VContabilView1.collectionModel}"
                              var="row"
                              rows="#{bindings.VContabilView1.rangeSize}"
                              emptyText="#{bindings.VContabilView1.viewable ? 'Não há registros para exibir.' : 'Access Denied.'}"
                              fetchSize="#{bindings.VContabilView1.rangeSize}"
                              rowBandingInterval="0" id="t11"
                              styleClass="AFStretchWidth"
                              inlineStyle="height:auto;" autoHeightRows="15">
                      <af:column sortProperty="CodBanco" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.CodBanco.label}"
                                 id="c11" align="center">
                        <af:outputText value="#{row.CodBanco}" id="ot52"
                                       noWrap="false"
                                       shortDesc="#{row.NmeBanco}"/>
                      </af:column>
                      <af:column sortProperty="CodCia" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.CodCia.label}"
                                 id="c40" align="center">
                        <af:outputText value="#{row.CodCia}" id="ot11"
                                       noWrap="false"
                                       shortDesc="#{row.NmeCia}"/>
                      </af:column>
                      <af:column sortProperty="DtaContabil" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.DtaContabil.label}"
                                 id="c22" align="center">
                        <af:outputText value="#{row.DtaContabil}" id="ot14">
                          <af:convertDateTime pattern="#{bindings.VContabilView1.hints.DtaContabil.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="VlrContabil" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.VlrContabil.label}"
                                 id="c20" align="center">
                        <af:outputText value="#{row.VlrContabil}" id="ot4"
                                       inlineStyle="float:right"/>
                      </af:column>
                      <af:column sortProperty="DscHistorico" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.DscHistorico.label}"
                                 id="c23" align="center">
                        <af:outputText value="#{row.DscHistorico}" id="ot30"/>
                      </af:column>
                      <af:column sortProperty="DesStepConciliacao"
                                 sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.DesStepConciliacao.label}"
                                 id="c39" align="center">
                        <af:outputText value="#{row.DesStepConciliacao}"
                                       id="ot23"/>
                      </af:column>
                      <af:column sortProperty="NumDocumento" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.NumDocumento.label}"
                                 id="c21" align="center">
                        <af:outputText value="#{row.NumDocumento}" id="ot26"/>
                      </af:column>
                      <af:column sortProperty="CodUnidNegocio" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.CodUnidNegocio.label}"
                                 id="c27" align="center">
                        <af:outputText value="#{row.CodUnidNegocio}" id="ot40"/>
                      </af:column>
                      <af:column sortProperty="CodDetMod" sortable="false"
                                 headerText="#{bindings.VContabilView1.hints.CodDetMod.label}"
                                 id="c53" align="center">
                        <af:outputText value="#{row.CodDetMod}" id="ot55">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.VContabilView1.hints.CodDetMod.format}"/>
                        </af:outputText>
                      </af:column>
                    </af:table>
                  </af:showDetailItem>
                  <af:showDetailItem id="sdi3" disclosed="true">
                    <af:table value="#{bindings.VTtGrpConcView1.collectionModel}"
                              var="row"
                              rows="#{bindings.VTtGrpConcView1.rangeSize}"
                              emptyText="#{bindings.VTtGrpConcView1.viewable ? 'Não há registros para exibir.' : 'Access Denied.'}"
                              fetchSize="#{bindings.VTtGrpConcView1.rangeSize}"
                              rowBandingInterval="0" id="t3"
                              styleClass="AFStretchWidth"
                              inlineStyle="height:auto;"
                              autoHeightRows="#{bindings.VTtGrpConcView1.rangeSize}">
                      <af:column sortProperty="CodGrupoContabilConc"
                                 sortable="false"
                                 headerText="#{bindings.VTtGrpConcView1.hints.CodGrupoContabilConc.label}"
                                 id="c5" align="center">
                        <af:outputText value="#{row.CodGrupoContabilConc}"
                                       id="ot15"/>
                      </af:column>
                      <af:column sortProperty="VlrGrupoConciliacao"
                                 sortable="false"
                                 headerText="#{bindings.VTtGrpConcView1.hints.VlrGrupoConciliacao.label}"
                                 id="c4" align="center">
                        <af:outputText value="#{row.VlrGrupoConciliacao}"
                                       id="ot18" inlineStyle="float:right"/>
                      </af:column>
                      <af:column sortProperty="DesStepConciliacao"
                                 sortable="false"
                                 headerText="#{bindings.VTtGrpConcView1.hints.DesStepConciliacao.label}"
                                 id="c26" align="center">
                        <af:outputText value="#{row.DesStepConciliacao}"
                                       id="ot20"/>
                      </af:column>
                    </af:table>
                  </af:showDetailItem>
                </af:panelAccordion>
              </af:panelGroupLayout>
            </af:group>
          </f:facet>
        </af:pageTemplate>
      </af:form>
    </af:document>
  </f:view>
</jsp:root>

[Empresa][Accurate][Embratel][ADF] Double Click na tabela

<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:adfp="http://xmlns.oracle.com/adf/faces/portlet">
  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
  <f:view>
    <af:document id="d1">
    
       <f:facet name="metaContainer">
          <af:resource type="javascript">
              function dblkfunction(event)
              {
                  var source = event.getSource();
                  AdfCustomEvent.queue(source, "doubleClickOnRow",{},false);
              }
         </af:resource>
       </f:facet>
       
      <af:messages id="m1"/>
      <af:form id="f1">
        <af:pageTemplate value="#{bindings.pageTemplateBinding.templateModel}"
                         id="pt1">
          <f:facet name="content">
            <af:group id="g1">
              <af:panelGroupLayout id="pgl3">
                <af:popup id="p1" contentDelivery="lazyUncached"
                          popupFetchListener="#{CadastraBancoBean.editPopupFetchListener}"
                          popupCanceledListener="#{CadastraBancoBean.editPopupCancelListener}"
                          binding="#{doubleClick.popupEditBanco}">
                  <af:dialog clientComponent="true" id="d2"
                             title="Cadastra Banco"
                             dialogListener="#{CadastraBancoBean.editDialogListener}"
                             resize="off">
                    <af:panelGroupLayout id="pgl1">
                      <af:panelFormLayout id="pfl1">
                        <af:inputText value="#{bindings.CodBanco.inputValue}"
                                      label="#{bindings.CodBanco.hints.label}"
                                      required="#{bindings.CodBanco.hints.mandatory}"
                                      columns="#{bindings.CodBanco.hints.displayWidth}"
                                      maximumLength="#{bindings.CodBanco.hints.precision}"
                                      shortDesc="#{bindings.CodBanco.hints.tooltip}"
                                      id="it1" showRequired="true"
                                      requiredMessageDetail="Código Banco é Obrigatório.">
                          <f:validator binding="#{bindings.CodBanco.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.NmeBanco.inputValue}"
                                      label="#{bindings.NmeBanco.hints.label}"
                                      required="#{bindings.NmeBanco.hints.mandatory}"
                                      columns="#{bindings.NmeBanco.hints.displayWidth}"
                                      maximumLength="#{bindings.NmeBanco.hints.precision}"
                                      shortDesc="#{bindings.NmeBanco.hints.tooltip}"
                                      id="it5" showRequired="true"
                                      requiredMessageDetail="Nome do Banco é Obrigatório.">
                          <f:validator binding="#{bindings.NmeBanco.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.StaConcLiquido.inputValue}"
                                      label="#{bindings.StaConcLiquido.hints.label}"
                                      required="#{bindings.StaConcLiquido.hints.mandatory}"
                                      columns="#{bindings.StaConcLiquido.hints.displayWidth}"
                                      maximumLength="#{bindings.StaConcLiquido.hints.precision}"
                                      shortDesc="#{bindings.StaConcLiquido.hints.tooltip}"
                                      id="it3" showRequired="true"
                                      requiredMessageDetail="Status Conciliacao é Obrigatório.">
                          <f:validator binding="#{bindings.StaConcLiquido.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.NmeResumido.inputValue}"
                                      label="#{bindings.NmeResumido.hints.label}"
                                      required="#{bindings.NmeResumido.hints.mandatory}"
                                      columns="#{bindings.NmeResumido.hints.displayWidth}"
                                      maximumLength="#{bindings.NmeResumido.hints.precision}"
                                      shortDesc="#{bindings.NmeResumido.hints.tooltip}"
                                      id="it2" showRequired="true"
                                      requiredMessageDetail="Nome Resumido é Obrigatório.">
                          <f:validator binding="#{bindings.NmeResumido.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.DscObs.inputValue}"
                                      label="#{bindings.DscObs.hints.label}"
                                      required="#{bindings.DscObs.hints.mandatory}"
                                      columns="#{bindings.DscObs.hints.displayWidth}"
                                      maximumLength="#{bindings.DscObs.hints.precision}"
                                      shortDesc="#{bindings.DscObs.hints.tooltip}"
                                      id="it4">
                          <f:validator binding="#{bindings.DscObs.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.CodBancoTombado.inputValue}"
                                      label="#{bindings.CodBancoTombado.hints.label}"
                                      required="#{bindings.CodBancoTombado.hints.mandatory}"
                                      columns="#{bindings.CodBancoTombado.hints.displayWidth}"
                                      maximumLength="#{bindings.CodBancoTombado.hints.precision}"
                                      shortDesc="#{bindings.CodBancoTombado.hints.tooltip}"
                                      id="it6">
                          <f:validator binding="#{bindings.CodBancoTombado.validator}"/>
                        </af:inputText>
                      </af:panelFormLayout>
                    </af:panelGroupLayout>
                  </af:dialog>
                </af:popup>
                <af:popup id="p2" contentDelivery="lazyUncached">
                  <af:dialog id="d3" type="yesNo" clientComponent="true"
                             title="Confirma Exclusão"
                             dialogListener="#{CadastraBancoBean.deleteDialogListener}">
                    <af:panelGroupLayout id="pgl2">
                      Tem Certeza que deseja Excluir o registro?
                    </af:panelGroupLayout>
                  </af:dialog>
                </af:popup>
              </af:panelGroupLayout>
              <af:panelAccordion id="pa1"
                                 styleClass="AFStretchWidth"
                                 dimensionsFrom="children">
                <af:showDetailItem text="Cadastro Banco" id="sdi1">
                  <af:table value="#{bindings.BancoView1.collectionModel}"
                            var="row" rows="#{bindings.BancoView1.rangeSize}"
                            emptyText="#{bindings.BancoView1.viewable ? 'Não há registros para exibir.' : 'Access Denied.'}"
                            fetchSize="#{bindings.BancoView1.rangeSize}"
                            rowBandingInterval="0"
                            selectedRowKeys="#{bindings.BancoView1.collectionModel.selectedRow}"
                            selectionListener="#{bindings.BancoView1.collectionModel.makeCurrent}"
                            id="t1" rowSelection="single" width="100%"
                            partialTriggers="::p1 ::d2 ::p2 ::d3"
                            binding="#{CadastraBancoBean.bindingEditBancoDtaAuteracao}">
                            
                    <af:clientListener method="dblkfunction" type="dblClick"/>
                    <af:serverListener type="doubleClickOnRow"  method="#{doubleClick.goEditCurrentRow}"/>
                            
                    <af:column sortProperty="CodBanco" sortable="true"
                               headerText="#{bindings.BancoView1.hints.CodBanco.label}"
                               id="c6" align="center">
                      <af:outputText value="#{row.CodBanco}" id="ot4"
                                     inlineStyle="text-align:center;"/>
                    </af:column>
                    <af:column sortProperty="NmeBanco" sortable="true"
                               headerText="#{bindings.BancoView1.hints.NmeBanco.label}"
                               id="c7" align="center">
                      <af:outputText value="#{row.NmeBanco}" id="ot9"/>
                    </af:column>
                    <af:column sortProperty="StaConcLiquido" sortable="true"
                               headerText="#{bindings.BancoView1.hints.StaConcLiquido.label}"
                               id="c1" align="center">
                      <af:outputText value="#{row.StaConcLiquido}" id="ot6"/>
                    </af:column>
                    <af:column sortProperty="NmeResumido" sortable="true"
                               headerText="#{bindings.BancoView1.hints.NmeResumido.label}"
                               id="c2" align="center">
                      <af:outputText value="#{row.NmeResumido}" id="ot1"/>
                    </af:column>
                    <af:column sortProperty="DtaCriacao" sortable="true"
                               headerText="#{bindings.BancoView1.hints.DtaCriacao.label}"
                               id="c5" align="center">
                      <af:outputText value="#{row.DtaCriacao}" id="ot7">
                        <af:convertDateTime pattern="#{bindings.BancoView1.hints.DtaCriacao.format}"/>
                      </af:outputText>
                    </af:column>
                    <af:column sortProperty="DscObs" sortable="true"
                               headerText="#{bindings.BancoView1.hints.DscObs.label}"
                               id="c8" align="center">
                      <af:outputText value="#{row.DscObs}" id="ot8"/>
                    </af:column>
                    <af:column sortProperty="CodBancoTombado" sortable="true"
                               headerText="#{bindings.BancoView1.hints.CodBancoTombado.label}"
                               id="c9" align="center">
                      <af:outputText value="#{row.CodBancoTombado}" id="ot3"/>
                    </af:column>
                    <af:column sortProperty="DtaAtualizacao" sortable="true"
                               headerText="#{bindings.BancoView1.hints.DtaAtualizacao.label}"
                               id="c3" align="center">
                      <af:outputText value="#{row.DtaAtualizacao}" id="ot5">
                        <af:convertDateTime pattern="#{bindings.BancoView1.hints.DtaAtualizacao.format}"/>
                      </af:outputText>
                    </af:column>
                    <af:column sortProperty="NmeLogin" sortable="true"
                               headerText="#{bindings.BancoView1.hints.NmeLogin.label}"
                               id="c4" align="center">
                      <af:outputText value="#{row.NmeLogin}" id="ot2"/>
                    </af:column>
                  </af:table>
                  <f:facet name="toolbar">
                    <af:toolbar id="t2">
                      <af:commandButton text="Novo" id="cbInsert">
                        <af:showPopupBehavior popupId="p1"/>
                      </af:commandButton>
                      <af:commandButton text="Editar" id="cb2">
                        <af:showPopupBehavior popupId="p1"/>
                      </af:commandButton>
                      <af:commandButton text="Excluir" id="cb3">
                        <af:showPopupBehavior popupId="p2"/>
                      </af:commandButton>
                    </af:toolbar>
                  </f:facet>
                </af:showDetailItem>
              </af:panelAccordion>
            </af:group>
          </f:facet>
        </af:pageTemplate>
      </af:form>
    </af:document>
  </f:view>
</jsp:root>

package br.com.embratel.conciliacao.mb;

import br.com.embratel.conciliacao.util.ADFUtils;

import java.util.Calendar;

import java.util.Date;

import javax.faces.application.FacesMessage;

import oracle.adf.model.BindingContext;

import oracle.adf.share.ADFContext;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.input.RichInputDate;
import oracle.adf.view.rich.component.rich.output.RichOutputFormatted;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.adf.view.rich.event.PopupCanceledEvent;

import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;

import oracle.adf.view.rich.event.PopupFetchEvent;

public class CadastraBancoBean {   
    private static final String GET_USER_EXPRESSION =
        "#{securityContext.userName}";
  private RichTable bindingEditBancoDtaAuteracao;

  public CadastraBancoBean() {
    }

    public void editPopupFetchListener(PopupFetchEvent popupFetchEvent) {           
        
        if (popupFetchEvent.getLaunchSourceClientId() != null && popupFetchEvent.getLaunchSourceClientId().contains("cbInsert")) {            
            BindingContainer bindings = getBindings(); 
            OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");            
            operationBinding.execute();
        }
        
    }
    
    public void editDialogListener(DialogEvent dialogEvent) {       
        if (dialogEvent.getOutcome().name().equals("ok")) {           
            BindingContainer bindings = getBindings();
            
            String nome =
                String.valueOf(ADFUtils.getExpressionValue(GET_USER_EXPRESSION));
        
            ADFUtils.setBoundAttributeValue("NmeLogin", nome);
            ADFUtils.setBoundAttributeValue("DtaAtualizacao", new Date());
         //   ADFUtils.addPartialTarget(bindingEditBancoDtaAuteracao);
            OperationBinding operationBinding = bindings.getOperationBinding("Commit");
            operationBinding.execute();
            
          
        } else if (dialogEvent.getOutcome().name().equals("cancel")) {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Rollback");
            operationBinding.execute();
        }
    }

    public void editPopupCancelListener(PopupCanceledEvent popupCanceledEvent) {
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Rollback");
        operationBinding.execute();
    }
    
    public BindingContainer getBindings() {
        System.out.print("Binding " + BindingContext.getCurrent().getCurrentBindingsEntry());
        return BindingContext.getCurrent().getCurrentBindingsEntry();
    }


    public void deleteDialogListener(DialogEvent dialogEvent) {
       
        if (dialogEvent.getOutcome().name().equals("yes")) { 
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Delete");            
            operationBinding.execute(); 
            OperationBinding operationBindingCommit = bindings.getOperationBinding("Commit");            
            operationBindingCommit.execute();
        } else if (dialogEvent.getOutcome().name().equals("no")) {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Rollback");
            operationBinding.execute();
        }
    }

  public void setBindingEditBancoDtaAuteracao(RichTable bindingEditBancoDtaAuteracao) {
    this.bindingEditBancoDtaAuteracao = bindingEditBancoDtaAuteracao;
  }

  public RichTable getBindingEditBancoDtaAuteracao() {
    return bindingEditBancoDtaAuteracao;
  }
}

package br.com.embratel.conciliacao.mb;

import br.com.embratel.conciliacao.util.ADFUtils;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;

import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.render.ClientEvent;

import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;

public class DoubleClickBean {


  private RichPopup popupEditBanco;

  public DoubleClickBean()
      {
          super();
      }
   
      public void goEditCurrentRow(ClientEvent clientEvent)
      {        System.out.println("------doubleclick------");
        
        abrirPopup(popupEditBanco);
      
      }
            
    public static void abrirPopup(RichPopup popup) {
         FacesContext context = FacesContext.getCurrentInstance();
         String popupId = popup.getClientId(context);

         StringBuilder script = new StringBuilder();
         script.append("var popup = AdfPage.PAGE.findComponent('");
         script.append(popupId).append("'); ");
         script.append("if (popup && !popup.isPopupVisible()) { ");
         script.append("var hints = {}; ");
         script.append("popup.show(hints);}");

         ADFUtils.adicionarFuncaoJavascript(script);
     }
   


  public void setPopupEditBanco(RichPopup popupEditBanco) {
    this.popupEditBanco = popupEditBanco;
  }

  public RichPopup getPopupEditBanco() {
    return popupEditBanco;
  }
}
package br.com.embratel.conciliacao.util;




import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.MethodExpression;

import javax.el.ValueExpression;

import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;

import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.model.binding.DCParameter;
import oracle.adf.view.rich.component.rich.data.RichTable;

import oracle.adf.view.rich.context.AdfFacesContext;

import oracle.binding.AttributeBinding;
import oracle.binding.BindingContainer;
import oracle.binding.ControlBinding;
import oracle.binding.OperationBinding;

import oracle.jbo.ApplicationModule;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.RowMatch;
import oracle.jbo.RowSetIterator;
import oracle.jbo.ViewObject;
import oracle.jbo.domain.Date;
import oracle.jbo.uicli.binding.JUCtrlHierBinding;
import oracle.jbo.uicli.binding.JUCtrlHierNodeBinding;
import oracle.jbo.uicli.binding.JUCtrlValueBinding;

import org.apache.myfaces.trinidad.model.CollectionModel;
import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;


public class ADFUtils {

    public static Object getExpressionValue(String expression) {
        ELContext elContext = FacesContext.getCurrentInstance().getELContext();
        return FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createValueExpression(elContext,
                                                                                                               expression,
                                                                                                               String.class).getValue(elContext);

    }
    
    public static Object getExpressionValue(String expression,
                                            Class tipoClasseRetorno) {
        ELContext elContext = FacesContext.getCurrentInstance().getELContext();
        return FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createValueExpression(elContext,
                                                                                                               expression,
                                                                                                               tipoClasseRetorno).getValue(elContext);

    }
    public static Date toOracleDate(java.util.Date date) {
        java.sql.Date sqlDate = new java.sql.Date(date.getTime());
        oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
        return jboDate;

    }

    /**
     * Get application module for an application module data control by name.
     * @param name application module data control name
     * @return ApplicationModule
     */
    public static ApplicationModule getApplicationModuleForDataControl(String name) {
        return (ApplicationModule)JSFUtils.resolveExpression("#{data." + name +
                                                             ".dataProvider}");
    }

    /**
     * A convenience method for getting the value of a bound attribute in the
     * current page context programatically.
     * @param attributeName of the bound value in the pageDef
     * @return value of the attribute
     */
    public static Object getBoundAttributeValue(String attributeName) {
        if (findControlBinding(attributeName) != null) {
            return findControlBinding(attributeName).getInputValue();
        } else {
            return null;
        }

    }

    /**
     * A convenience method for setting the value of a bound attribute in the
     * context of the current page.
     * @param attributeName of the bound value in the pageDef
     * @param value to set
     */
    public static void setBoundAttributeValue(String attributeName,
                                              Object value) {
        findControlBinding(attributeName).setInputValue(value);
    }

    /**
     * Returns the evaluated value of a pageDef parameter.
     * @param pageDefName reference to the page definition file of the page with the parameter
     * @param parameterName name of the pagedef parameter
     * @return evaluated value of the parameter as a String
     */
    public static Object getPageDefParameterValue(String pageDefName,
                                                  String parameterName) {
        BindingContainer bindings = findBindingContainer(pageDefName);
        DCParameter param =
            ((DCBindingContainer)bindings).findParameter(parameterName);
        return param.getValue();
    }

    /**
     * Convenience method to find a DCControlBinding as an AttributeBinding
     * to get able to then call getInputValue() or setInputValue() on it.
     * @param bindingContainer binding container
     * @param attributeName name of the attribute binding.
     * @return the control value binding with the name passed in.
     *
     */
    public static AttributeBinding findControlBinding(BindingContainer bindingContainer,
                                                      String attributeName) {
        if (attributeName != null) {
            if (bindingContainer != null) {
                ControlBinding ctrlBinding =
                    bindingContainer.getControlBinding(attributeName);
                if (ctrlBinding instanceof AttributeBinding) {
                    return (AttributeBinding)ctrlBinding;
                }
            }
        }
        return null;
    }

    /**
     * Convenience method to find a DCControlBinding as a JUCtrlValueBinding
     * to get able to then call getInputValue() or setInputValue() on it.
     * @param attributeName name of the attribute binding.
     * @return the control value binding with the name passed in.
     *
     */
    public static AttributeBinding findControlBinding(String attributeName) {
        return findControlBinding(getBindingContainer(), attributeName);
    }

    /**
     * Return the current page's binding container.
     * @return the current page's binding container
     */
    public static BindingContainer getBindingContainer() {
        return (BindingContainer)JSFUtils.resolveExpression("#{bindings}");
    }

    /**
     * Return the Binding Container as a DCBindingContainer.
     * @return current binding container as a DCBindingContainer
     */
    public static DCBindingContainer getDCBindingContainer() {
        return (DCBindingContainer)getBindingContainer();
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding.
     *
     * Uses the value of the 'valueAttrName' attribute as the key for
     * the SelectItem key.
     *
     * @param iteratorName ADF iterator binding name
     * @param valueAttrName name of the value attribute to use
     * @param displayAttrName name of the attribute from iterator rows to display
     * @return ADF Faces SelectItem for an iterator binding
     */
    public static List<SelectItem> selectItemsForIterator(String iteratorName,
                                                          String valueAttrName,
                                                          String displayAttrName) {
        return selectItemsForIterator(findIterator(iteratorName),
                                      valueAttrName, displayAttrName);
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding with description.
     *
     * Uses the value of the 'valueAttrName' attribute as the key for
     * the SelectItem key.
     *
     * @param iteratorName ADF iterator binding name
     * @param valueAttrName name of the value attribute to use
     * @param displayAttrName name of the attribute from iterator rows to display
     * @param descriptionAttrName name of the attribute to use for description
     * @return ADF Faces SelectItem for an iterator binding with description
     */
    public static List<SelectItem> selectItemsForIterator(String iteratorName,
                                                          String valueAttrName,
                                                          String displayAttrName,
                                                          String descriptionAttrName) {
        return selectItemsForIterator(findIterator(iteratorName),
                                      valueAttrName, displayAttrName,
                                      descriptionAttrName);
    }

    /**
     * Get List of attribute values for an iterator.
     * @param iteratorName ADF iterator binding name
     * @param valueAttrName value attribute to use
     * @return List of attribute values for an iterator
     */
    public static List attributeListForIterator(String iteratorName,
                                                String valueAttrName) {
        return attributeListForIterator(findIterator(iteratorName),
                                        valueAttrName);
    }

    /**
     * Get List of Key objects for rows in an iterator.
     * @param iteratorName iterabot binding name
     * @return List of Key objects for rows
     */
    public static List<Key> keyListForIterator(String iteratorName) {
        return keyListForIterator(findIterator(iteratorName));
    }

    /**
     * Get List of Key objects for rows in an iterator.
     * @param iter iterator binding
     * @return List of Key objects for rows
     */
    public static List<Key> keyListForIterator(DCIteratorBinding iter) {
        List<Key> attributeList = new ArrayList<Key>();
        for (Row r : getAllRows(iter)) {
            attributeList.add(r.getKey());
        }
        return attributeList;
    }

    /**
     * Get List of Key objects for rows in an iterator using key attribute.
     * @param iteratorName iterator binding name
     * @param keyAttrName name of key attribute to use
     * @return List of Key objects for rows
     */
    public static List<Key> keyAttrListForIterator(String iteratorName,
                                                   String keyAttrName) {
        return keyAttrListForIterator(findIterator(iteratorName), keyAttrName);
    }

    /**
     * Get List of Key objects for rows in an iterator using key attribute.
     *
     * @param iter iterator binding
     * @param keyAttrName name of key attribute to use
     * @return List of Key objects for rows
     */
    public static List<Key> keyAttrListForIterator(DCIteratorBinding iter,
                                                   String keyAttrName) {
        List<Key> attributeList = new ArrayList<Key>();
        for (Row r : iter.getAllRowsInRange()) {
            attributeList.add(new Key(new Object[] { r.getAttribute(keyAttrName) }));
        }
        return attributeList;
    }

    /**
     * Get a List of attribute values for an iterator.
     *
     * @param iter iterator binding
     * @param valueAttrName name of value attribute to use
     * @return List of attribute values
     */
    public static List attributeListForIterator(DCIteratorBinding iter,
                                                String valueAttrName) {
        List attributeList = new ArrayList();
        String name = iter.getViewObject().getRowSet().getName() + "meuRowSet";
        RowSetIterator rowSetIt =
            iter.getViewObject().findRowSetIterator(name);
        if (rowSetIt == null) {
            rowSetIt = iter.getViewObject().createRowSetIterator(name);
        }
        int count = rowSetIt.getEstimatedRangePageCount();
        for (int i = 0; i < count; ++i) {
            rowSetIt.setRangeStart(rowSetIt.getRangeSize() * i);
            for (Row r : rowSetIt.getAllRowsInRange()) {
                attributeList.add(r.getAttribute(valueAttrName));
            }
        }
        return attributeList;
    }

    /**
     * Find an iterator binding in the current binding container by name.
     *
     * @param name iterator binding name
     * @return iterator binding
     */
    public static DCIteratorBinding findIterator(String name) {
        DCIteratorBinding iter =
            getDCBindingContainer().findIteratorBinding(name);
        if (iter == null) {
            throw new RuntimeException("Iterator '" + name + "' not found");
        }
        return iter;
    }

    /**
     * @param bindingContainer
     * @param iterator
     * @return
     */
    public static DCIteratorBinding findIterator(String bindingContainer,
                                                 String iterator) {
        DCBindingContainer bindings =
            (DCBindingContainer)JSFUtils.resolveExpression("#{" +
                                                           bindingContainer +
                                                           "}");
        if (bindings == null) {
            throw new RuntimeException("Binding container '" +
                                       bindingContainer + "' not found");
        }
        DCIteratorBinding iter = bindings.findIteratorBinding(iterator);
        if (iter == null) {
            throw new RuntimeException("Iterator '" + iterator +
                                       "' not found");
        }
        return iter;
    }

    /**
     * @param name
     * @return
     */
    public static JUCtrlValueBinding findCtrlBinding(String name) {
        JUCtrlValueBinding rowBinding =
            (JUCtrlValueBinding)getDCBindingContainer().findCtrlBinding(name);
        if (rowBinding == null) {
            throw new RuntimeException("CtrlBinding " + name + "' not found");
        }
        return rowBinding;
    }

    /**
     * Find an operation binding in the current binding container by name.
     *
     * @param name operation binding name
     * @return operation binding
     */
    public static OperationBinding findOperation(String name) {
        OperationBinding op =
            getDCBindingContainer().getOperationBinding(name);
        if (op == null) {
            throw new RuntimeException("Operation '" + name + "' not found");
        }
        return op;
    }

    /**
     * Find an operation binding in the current binding container by name.
     *
     * @param bindingContianer binding container name
     * @param opName operation binding name
     * @return operation binding
     */
    public static OperationBinding findOperation(String bindingContianer,
                                                 String opName) {
        DCBindingContainer bindings =
            (DCBindingContainer)JSFUtils.resolveExpression("#{" +
                                                           bindingContianer +
                                                           "}");
        if (bindings == null) {
            throw new RuntimeException("Binding container '" +
                                       bindingContianer + "' not found");
        }
        OperationBinding op = bindings.getOperationBinding(opName);
        if (op == null) {
            throw new RuntimeException("Operation '" + opName + "' not found");
        }
        return op;
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding with description.
     *
     * Uses the value of the 'valueAttrName' attribute as the key for
     * the SelectItem key.
     *
     * @param iter ADF iterator binding
     * @param valueAttrName name of value attribute to use for key
     * @param displayAttrName name of the attribute from iterator rows to display
     * @param descriptionAttrName name of the attribute for description
     * @return ADF Faces SelectItem for an iterator binding with description
     */
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding iter,
                                                          String valueAttrName,
                                                          String displayAttrName,
                                                          String descriptionAttrName) {
        List<SelectItem> selectItems = new ArrayList<SelectItem>();
        for (Row r : iter.getAllRowsInRange()) {
            selectItems.add(new SelectItem(r.getAttribute(valueAttrName),
                                           (String)r.getAttribute(displayAttrName),
                                           (String)r.getAttribute(descriptionAttrName)));
        }
        return selectItems;
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding.
     *
     * Uses the value of the 'valueAttrName' attribute as the key for
     * the SelectItem key.
     *
     * @param iter ADF iterator binding
     * @param valueAttrName name of value attribute to use for key
     * @param displayAttrName name of the attribute from iterator rows to display
     * @return ADF Faces SelectItem for an iterator binding
     */
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding iter,
                                                          String valueAttrName,
                                                          String displayAttrName) {
        List<SelectItem> selectItems = new ArrayList<SelectItem>();
        for (Row r : iter.getAllRowsInRange()) {
            selectItems.add(new SelectItem(r.getAttribute(valueAttrName),
                                           (String)r.getAttribute(displayAttrName)));
        }
        return selectItems;
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding.
     *
     * Uses the rowKey of each row as the SelectItem key.
     *
     * @param iteratorName ADF iterator binding name
     * @param displayAttrName name of the attribute from iterator rows to display
     * @return ADF Faces SelectItem for an iterator binding
     */
    public static List<SelectItem> selectItemsByKeyForIterator(String iteratorName,
                                                               String displayAttrName) {
        return selectItemsByKeyForIterator(findIterator(iteratorName),
                                           displayAttrName);
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding with discription.
     *
     * Uses the rowKey of each row as the SelectItem key.
     *
     * @param iteratorName ADF iterator binding name
     * @param displayAttrName name of the attribute from iterator rows to display
     * @param descriptionAttrName name of the attribute for description
     * @return ADF Faces SelectItem for an iterator binding with discription
     */
    public static List<SelectItem> selectItemsByKeyForIterator(String iteratorName,
                                                               String displayAttrName,
                                                               String descriptionAttrName) {
        return selectItemsByKeyForIterator(findIterator(iteratorName),
                                           displayAttrName,
                                           descriptionAttrName);
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding with discription.
     *
     * Uses the rowKey of each row as the SelectItem key.
     *
     * @param iter ADF iterator binding
     * @param displayAttrName name of the attribute from iterator rows to display
     * @param descriptionAttrName name of the attribute for description
     * @return ADF Faces SelectItem for an iterator binding with discription
     */
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding iter,
                                                               String displayAttrName,
                                                               String descriptionAttrName) {
        List<SelectItem> selectItems = new ArrayList<SelectItem>();
        for (Row r : iter.getAllRowsInRange()) {
            selectItems.add(new SelectItem(r.getKey(),
                                           (String)r.getAttribute(displayAttrName),
                                           (String)r.getAttribute(descriptionAttrName)));
        }
        return selectItems;
    }

    /**
     * Get List of ADF Faces SelectItem for an iterator binding.
     *
     * Uses the rowKey of each row as the SelectItem key.
     *
     * @param iter ADF iterator binding
     * @param displayAttrName name of the attribute from iterator rows to display
     * @return List of ADF Faces SelectItem for an iterator binding
     */
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding iter,
                                                               String displayAttrName) {
        List<SelectItem> selectItems = new ArrayList<SelectItem>();
        for (Row r : iter.getAllRowsInRange()) {
            selectItems.add(new SelectItem(r.getKey(),
                                           (String)r.getAttribute(displayAttrName)));
        }
        return selectItems;
    }

    /**
     * Find the BindingContainer for a page definition by name.
     *
     * Typically used to refer eagerly to page definition parameters. It is
     * not best practice to reference or set bindings in binding containers
     * that are not the one for the current page.
     *
     * @param pageDefName name of the page defintion XML file to use
     * @return BindingContainer ref for the named definition
     */
    private static BindingContainer findBindingContainer(String pageDefName) {
        BindingContext bctx = getDCBindingContainer().getBindingContext();
        BindingContainer foundContainer =
            bctx.findBindingContainer(pageDefName);
        return foundContainer;
    }

    public static Object resolveMethodExpression(String expression,
                                                 Class returnType,
                                                 Class[] argTypes,
                                                 Object[] argValues) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application app = facesContext.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = facesContext.getELContext();
        MethodExpression methodExpression =
            elFactory.createMethodExpression(elContext, expression, returnType,
                                             argTypes);
        return methodExpression.invoke(elContext, argValues);
    }

    public static void showMessage(String uIComponentId,
                                   FacesMessage.Severity severity,
                                   String messageContext, String message) {
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(uIComponentId,
                           new FacesMessage(severity, messageContext,
                                            message));
    }

    /**
     *Executa alguma operacao que esteja no binding da pagina
     * @param bindingContainer
     * @param nomeOperacao na pagina de binding
     * @param parametros se nao existir passar null
     * @return
     */
    public static Object executar(BindingContainer bindingContainer,
                                  String nomeOperacao,
                                  Map<String, Object> parametros) {

        OperationBinding operacao =
            bindingContainer.getOperationBinding(nomeOperacao);
        if (parametros != null) {
            operacao.getParamsMap().clear();
            operacao.getParamsMap().putAll(parametros);

        }

        Object obj = operacao.execute();
        return obj;
    }

    /**
     *Retorna todas as linhas do Iterator
     * @param iterator
     * @return
     */
    public static List<Row> getAllRows(DCIteratorBinding iterator) {
        return getAllRows(iterator.getViewObject());
    }

    public static List<Row> getAllRows(ViewObject view) {
        String name = "_NovoRowSetIterator_";
        RowSetIterator rowIterator = view.findRowSetIterator(name);
        if (rowIterator == null)
            rowIterator = view.createRowSetIterator(name);
        return getAllRows(rowIterator);
    }


    /**
     *Retorna todas as linhas do RowSet
     * @param rowSetIterator
     * @return
     */
    public static List<Row> getAllRows(RowSetIterator rowSetIterator) {
        int rangeSize = rowSetIterator.getRangeSize();
        rowSetIterator.setRangeSize(-1);
        Row[] rows = rowSetIterator.getAllRowsInRange();
        List<Row> list = null;
        if (rows != null && rows.length > 0) {
            list = Arrays.asList(rows);
        } else {
            list = Collections.emptyList();
        }
        //configura novamente o range
        rowSetIterator.setRangeSize(rangeSize);
        return list;
    }


    /**
     *Filtra os dados contidos na RowSet passado como parametros
     * @param rowSet
     * @param attr
     * @param value
     * @return
     */
    public static List<Row> filter(RowSetIterator rowSet, String attr,
                                   Object value) {
        List<Row> listRows = getAllRows(rowSet);
        return filter(listRows, attr, value);
    }

    /**
     * Filtra os dados no Iterator passado como parametro
     * @param iterator
     * @param attr
     * @param value
     * @return
     */
    public static List<Row> filter(DCIteratorBinding iterator, String attr,
                                   Object value) {
        List<Row> listRows = getAllRows(iterator);
        return filter(listRows, attr, value);
    }


    public static List<Row> filter(List<Row> allRows, String attr,
                                   Object value) {
        List<Row> listFilter = new ArrayList<Row>((int)allRows.size() / 2);
        for (Row row : allRows) {
            Object object = row.getAttribute(attr);
            if (object != null && object.equals(value)) {
                listFilter.add(row);
            }
        }
        return listFilter;
    }

    /**
     * Criado para filtrar com base em uma clausula where
     */
    public static List<Row> filter(List<Row> allRows, String where) {
        List<Row> listFilter = new ArrayList<Row>((int)allRows.size() / 2);
        RowMatch match = new RowMatch(where);
        for (Row row : allRows) {
            if (match.rowQualifies(row)) {
                listFilter.add(row);
            }
        }
        return listFilter;
    }

    public static Row buscaLinhaTabela(RichTable tabela) {
        CollectionModel tableModel = (CollectionModel)tabela.getValue();
        JUCtrlHierBinding adfTableBinding =
            (JUCtrlHierBinding)tableModel.getWrappedData();
        DCIteratorBinding tableIteratorBinding =

            adfTableBinding.getDCIteratorBinding();

        Object selectedRowData = tabela.getSelectedRowData();
        JUCtrlHierNodeBinding nodeBinding =

            (JUCtrlHierNodeBinding)selectedRowData;
        Key key = nodeBinding.getRowKey();
        tableIteratorBinding.setCurrentRowWithKey(key.toStringFormat(true));

        return tableIteratorBinding.getCurrentRow();
    }

    /**
     * Define uma mensagem com severidade WARNING
     *
     * @param mensagem Mensagem a ser exibida para o usuario
     */
    public static void adicionarMensagemAtencao(String mensagem) {
        FacesContext.getCurrentInstance().addMessage(null,
                                                     new FacesMessage(FacesMessage.SEVERITY_INFO,
                                                                      mensagem,
                                                                      mensagem));
    }

    /**
     * Define uma mensagem com severidade ERROR
     *
     * @param mensagem Mensagem a ser exibida para o usuario
     */
    public static void adicionarMensagemErro(String mensagem) {
        FacesContext.getCurrentInstance().addMessage(null,
                                                     new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                                                      mensagem,
                                                                      mensagem));
    }
    
  /**
     * Shows the specified popup component and its contents
     * @param popupId is the clientId of the popup to be shown
     * clientId is derived from backing bean for the af:popup using getClientId method
     */
    public static void invokePopup(String popupId) {
        invokePopup(popupId, "AdfRichPopup.ALIGN_AFTER_START", null);
    }

    /**
     * Shows the specified popup and uses the specified hints to align the popup.
     * @param popupId is the clientId of the popup to be shown - clientId is derived from backing bean for the af:popup using getClientId method
     * @param align is a hint for the popup display. Check AdfRichPopup js javadoc for valid values. Supported value includes: "AdfRichPopup.ALIGN_START_AFTER", "AdfRichPopup.ALIGN_BEFORE_START" and "AdfRichPopup.ALIGN_END_BEFORE"
     * @param alignId is the clientId of the component the popup should align to - clientId is derived from backing bean for the component using getClientId method
     * align and alignId need to be specified together - specifying null for either of them will have no effect.
     */
    public static void invokePopup(String popupId, String align, String alignId) {
        if (popupId != null) {
            FacesContext context = FacesContext.getCurrentInstance();
            StringBuilder script = new StringBuilder();
            script.append("var popup = AdfPage.PAGE.findComponent('");
            script.append(popupId);
            script.append("'); ");
            script.append("if (!popup.isPopupVisible()) { ");
            script.append("var hints = {}; n");
            if (align != null) {
                script.append(" hints[AdfRichPopup.HINT_ALIGN] = ");
                script.append(align);
                script.append(";n");
            }
            if (alignId != null) {
                script.append(" hints[AdfRichPopup.HINT_ALIGN_ID] = '");
                script.append(alignId);
                script.append("';n ");
            }
            script.append("popup.show(hints);");
            script.append("}");

            ExtendedRenderKitService erks = Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);

            erks.addScript(context, script.toString());
        }
    }
    
    
    public static void setValueBinding(String binding, Object value) {
         try {
             FacesContext fctx = FacesContext.getCurrentInstance();
             ValueExpression vle =
                 fctx.getApplication().getExpressionFactory().createValueExpression(fctx.getELContext(),
                                                                                    binding,
                                                                                    value.getClass());
             vle.setValue(fctx.getELContext(), value);
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
    
    
    public static void addFacesInfoMessage(String attrNameKey, String msg) {
          FacesContext ctx = FacesContext.getCurrentInstance();
          FacesMessage fm =
              new FacesMessage(FacesMessage.SEVERITY_INFO, null, msg);
          ctx.addMessage(attrNameKey, fm);
    }
    
    public static void addPartialTarget(UIComponent component) {
        AdfFacesContext.getCurrentInstance().addPartialTarget(component);
    }
    
    public static void adicionarFuncaoJavascript(StringBuilder funcaoJS) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExtendedRenderKitService service = Service.getRenderKitService(facesContext,
                                                                      ExtendedRenderKitService.class);
            service.addScript(facesContext, funcaoJS.toString());
    }

  
}