0

我在这里做了这段代码,q旨在列出银行的值,并且用户可以更新日期,甚至通过dataTable。到目前为止,我设法做到了这一点,只是设置了用户输入的值。我在世界任何地方都找不到这个值,已经运行了 tdo 并且在框中输入的值没有出现。我使用了几种类型的变量,但没有。

 <p:dataTable id="dataTable"
                             var="Arquivo"
                             paginator="true"
                             paginatorPosition="bottom"
                             rowsPerPageTemplate="100"
                             rows="100"
                             sortBy="#{Arquivo.id}"
                             value="#{arquivoBean.dataModelArquivo}"  
                             rowStyleClass="#{Arquivo.pendente eq 1 ? 'ok' : 'erro'}"
                             >
                    <p:column headerText="ID">
                        #{Arquivo.id}
                    </p:column>
                    <p:column headerText="Nome">
                        #{Arquivo.nome}
                    </p:column>
                    <p:column headerText="Envio">
                        #{Arquivo.dataEnvio}
                    </p:column>
                    <p:column headerText="Produto" width="10px;">
                        <h:form id="formProduto">
                            <p:commandButton icon="ui-icon-circle-zoomout" value="" 
                                             action="#{arquivoBean.listarProdutoPorArquivo()}" 
                                             oncomplete="prodDialog.show()"
                                             update=":form:dataTableProd"
                                             onclick="listarProd([{name: 'ArquivoId', value:#{Arquivo.id}}]);">
                                <f:setPropertyActionListener value="#{Arquivo}" target="#{arquivoBean.arquivo}"/>
                            </p:commandButton>
                        </h:form>
                    </p:column>
                    <p:column headerText="Data" >
                        <p:inputMask id ="entrada#{cc.clientId}" mask="99/99/9999" value="#{Arquivo.dataEntrada}"
                                     onkeypress="if (event.keyCode === 13) {
                                                         test([{name: 'ArquivoId', value:#{Arquivo.id}}]);
                                                         return;
                                                     };"
                                     size="8">
                            <f:convertDateTime pattern="dd/MM/yyyy"/>
                        </p:inputMask>
                    </p:column>
                </p:dataTable>

经过一番摸索,我发现了这个错误检查器元素的 chrome,标签网络:

<partial-response id="j_id1"><error><error-name>class java.lang.NullPointerException</error-name><error-message><![CDATA[]]></error-message></error></partial-response>
4

1 回答 1

0

我修复了删除表单块并将许多表单放置在需要的位置。只是它使作品。

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://xmlns.jcp.org/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui"
  xmlns:f="http://java.sun.com/jsf/core">

<ui:decorate template="/resources/Template.xhtml">
    <ui:define id="content" name="content">
        <p:growl id="war"/>
        <style type="text/css">
            .ok{  
                color: #336600
            }
            .erro{
                color: #D20005;
            }
        </style>

        <div style="width: 90%; margin-left: auto; margin-right: auto; ">
            <h:form id="form">
                <br/>
                <br/>
                <p:panel>
                    <f:facet name="header">
                        Lista de Arquivos Armazenados                        
                    </f:facet>       
                    <h:form id="pesquisar">
                        <p:toolbar style="width: 100%;">
                            <p:toolbarGroup align="left" >
                                <h:panelGrid columns="1" cellpadding="0">                            
                                </h:panelGrid>
                            </p:toolbarGroup>                        
                            <p:toolbarGroup align="right">
                                <h:panelGrid columns="5" cellpadding="0">
                                    <h:outputLabel value="De: "/>  
                                    <p:inputMask mask="99/99/9999" value="#{arquivoBean.dataInicial}" size="10"/>
                                    <h:outputLabel value="Até: "/>  
                                    <p:inputMask mask="99/99/9999" value="#{arquivoBean.datafinal}" size="10"/>
                                    <p:commandButton value="Buscar" action="#{arquivoBean.listar()}"  update=":form:dataTable" ajax="false"/>
                                    <br/>
                                    <p:selectBooleanCheckbox id="check" value="#{arquivoBean.pendente}"
                                                             itemLabel="Pendente">
                                        <p:ajax process="@this" event="change" listener="#{arquivoBean.listarPendente()}" update=":form:dataTable" />
                                    </p:selectBooleanCheckbox>
                                    <p:button value="Ajustar Datas" outcome="/telas/armazenado/listaData.xhtml"/>
                                </h:panelGrid>

                            </p:toolbarGroup>
                        </p:toolbar>
                    </h:form>
                </p:panel>
                <br/>
                <p:dataTable id="dataTable"
                             var="Arquivo"
                             paginator="true"
                             paginatorPosition="bottom"
                             rowsPerPageTemplate="100"
                             rows="100"
                             sortBy="#{Arquivo.id}"
                             value="#{arquivoBean.dataModelArquivo}"  
                             rowStyleClass="#{Arquivo.pendente eq 1 ? 'ok' : 'erro'}"
                             emptyMessage="Você ainda não ativou uma empresa ou não existe postagem para esta Empresa">
                    <p:column headerText="ID">
                        #{Arquivo.id}
                    </p:column>
                    <p:column headerText="Nome">
                        #{Arquivo.nomeMury}
                    </p:column>
                    <p:column headerText="Envio">
                        #{Arquivo.dataEnvio}
                    </p:column>
                    <p:column headerText="Produto" width="10px;">
                        <h:form id="formProduto">
                            <p:commandButton icon="ui-icon-circle-zoomout" value="" 
                                             action="#{arquivoBean.listarProdutoPorArquivo()}" 
                                             oncomplete="prodDialog.show()"
                                             update=":form:dataTableProd"
                                             onclick="listarProd([{name: 'ArquivoId', value:#{Arquivo.id}}]);">
                                <f:setPropertyActionListener value="#{Arquivo}" target="#{arquivoBean.arquivo}"/>
                            </p:commandButton>
                        </h:form>
                    </p:column>
                </p:dataTable>
                <p:dialog closeOnEscape="true" 
                          widgetVar="prodDialog" 
                          modal="true" 
                          header="Lista de Produtos da NF-e"
                          style="width: 300; height: 500"
                          position="center">
                    <p:dataTable
                        id="dataTableProd"
                        var="XmlItens"
                        paginator="true"
                        paginatorPosition="bottom"
                        rowsPerPageTemplate="10"
                        rows="10"
                        value="#{arquivoBean.listaProd}">
                        <p:column headerText="ID">
                            #{XmlItens.id}
                        </p:column>
                        <p:column headerText="Nome">
                            #{XmlItens.descricaoProd}
                        </p:column>
                        <p:column headerText="Envio">
                            #{XmlItens.chaveNfe}
                        </p:column>
                    </p:dataTable>
                    <p:remoteCommand name="test" action="#{arquivoBean.inserirDataNota()}">
                        <f:setPropertyActionListener value="#{Arquivo}" target="#{arquivoBean.arquivo}"/>
                    </p:remoteCommand>
                    <p:remoteCommand name="listarProd" action="#{arquivoBean.listarProdutoPorArquivo()}" update=":form:dataTableProd">
                        <f:setPropertyActionListener value="#{Arquivo}" target="#{arquivoBean.arquivo}"/>
                    </p:remoteCommand>
                </p:dialog>
            </h:form>
        </div>
    </ui:define>
</ui:decorate>
</html>
于 2013-09-25T12:11:28.073 回答