[Resolvido] erro de validação selectonemenu

5 respostas
M

e ai galera. seguinte quando submeto meu formulario ele da erro de validação no selectOneMenu… não to usando pojo coloco o selectItem na mão mesmo… vai ter gente que vai pedir pra eu substituir o hash e o equal. ja fiz isso ja e nada ainda. uma coisa engraçado é que incluir funciona normal, agora qndo faço um update ele da a msg de validação.

segue abaixo meu jsf

<!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:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Lançamentos</title>
</h:head>
<h:body>
	<h:form id="form">
		<p:growl id="messages" />
		<ui:include src="/menu.xhtml" />
		<div class="conteudo">
			<p:panel header="Lançamentos" id="panel" style="height:587px">
				<br></br>
				<div align="left">
					<p:commandButton update="dialog1, messages"
						actionListener="#{contaPagarBean.limpar}" oncomplete="dlg1.show()"
						icon="ui-icon-plusthick" immediate="true" process="@this" />
				</div>
				<br></br>
				<div align="left">
					<!-- Começo Da Pesquisa Do lançamento  -->
					<p:dataTable var="lancamento" value="#{contaPagarBean.lancamentos}"
						widgetVar="lancamentoTable"
						emptyMessage="Nenhum Lancamento Encontrado Nessas Condições"
						rowStyleClass="#{empty rowIx or rowIx mod 2 ne 0 ? 'even-row' : 'odd-row'}"
						rowIndexVar="rowIx" id="tbl1" rows="10"
						rowsPerPageTemplate="10,15,30" paginator="true">

						<f:facet name="header">
							<p:outputPanel>
								<table align="right">
									<tr>
										<td width="70%"></td>
										<td><p:selectOneMenu value="#{contaPagarBean.filtro}"
												immediate="true" style="width: 150px">

											</p:selectOneMenu></td>
										<td><p:inputText value="#{contaPagarBean.param}" /></td>
										<td><p:commandButton
												action="#{contaPagarBean.getlancamentos}"
												icon="ui-icon-search" update="tbl1" /></td>
									</tr>
								</table>
							</p:outputPanel>
						</f:facet>

						<p:column headerText="Favorecido" footerText="Favorecido"
							filterMatchMode="contains">
							<f:facet name="header">  
                    			Favorecido
          				  </f:facet>
							<h:outputText value="#{lancamento.fornecedor.nome}" />
						</p:column>

						<p:column headerText="Forma Pgto" footerText="Forma Pgto">
							<f:facet name="header">  
                    Forma Pgto
            </f:facet>
							<h:outputText value="#{lancamento.formaPagamento}" />
						</p:column>

						<p:column headerText="Data" footerText="Data"
							filterMatchMode="contains" style="width: 90px">
							<f:facet name="header">  
                    Data  
            </f:facet>
							<h:outputText value="#{lancamento.data}" style="width: 90px" />
						</p:column>

						<p:column headerText="Valor" footerText="Valor"
							style="width: 90px">
							<f:facet name="header">  
                    Valor  
            </f:facet>
							<h:outputText value="#{lancamento.valor}" style="width: 90px" />
						</p:column>

						<p:column style="width:1px">
							<p:commandButton icon="ui-icon-pencil" title="Editar"
								update=":form:form2:dialog2" oncomplete="dlg2.show()"
								style="font-size: 8px !important;" ajax="true">
								<f:setPropertyActionListener value="#{lancamento}"
									target="#{contaPagarBean.lancamentoUpdate}" />

							</p:commandButton>


						</p:column>

						<p:column style="width:1px">
							<p:commandButton icon="ui-icon-trash" title="Excluir"
								oncomplete="confirmation.show()"
								style="font-size: 8px !important;  ">
								<f:setPropertyActionListener value="#{lancamento}"
									target="#{contaPagarBean.lancamento}" />
							</p:commandButton>

						</p:column>
					</p:dataTable>

					<p:confirmDialog id="confirmDialog" message="Confirma Exclusão?"
						severity="alert" widgetVar="confirmation">

						<p:commandButton id="confirm" value="Sim" update="tbl1, messages"
							oncomplete="confirmation.hide()"
							actionListener="#{contaPagarBean.deletar}">

						</p:commandButton>
						<p:commandButton id="decline" value="Não"
							onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</div>

				<!-- Fim Da Pesquisa Do Produto -->

				<br></br>
				<br></br>
				<!-- Começo Exporta Dados  -->

				<h:commandLink>
					<p:graphicImage value="/imagens/pdf.png" />
					<p:dataExporter type="pdf" target="tbl1" encoding="iso-8859-1"
						preProcessor="#{dataExporterBean.preProcessPDF}"
						fileName="lançamentos" excludeColumns="5, 6" />
				</h:commandLink>

				<!-- Fim Exporta Dados -->

				<!-- Começo Cadastro de Lançamento -->

				<p:dialog header="Cadastrar Lançamento" widgetVar="dlg1"
					resizable="false" width="850" height="600" modal="true"
					id="dialog1">

					<h:panelGrid id="panelCad">

						<table>
							<tr>
								<td align="right"><h:outputLabel value="Documento: " /></td>
								<td align="left"><p:selectOneMenu id="documento"
										value="#{contaPagarBean.lancamento.documento}">
										<f:selectItem itemLabel="Boleto" itemValue="Boleto" />
										<f:selectItem itemLabel="Carnê" itemValue="Carnê" />
										<f:selectItem itemLabel="Cartaão de Crédito"
											itemValue="Cartão de Crédito" />
										<f:selectItem itemLabel="Cartão de Débito"
											itemValue="Cartão de Débito" />
										<f:selectItem itemLabel="Cheque" itemValue="Cheque" />
										<f:selectItem itemLabel="DARF" itemValue="DARF" />
										<f:selectItem itemLabel="Depósito Em Conta Corrente"
											itemValue="Depósito Em Conta Corrente" />
										<f:selectItem itemLabel="Dinheiro" itemValue="Dinheiro" />
										<f:selectItem itemLabel="Duplicata" itemValue="Duplicata" />
										<f:selectItem itemLabel="Débito Em Conta"
											itemValue="Débito Em Conta" />
										<f:selectItem itemLabel="Fatura" itemValue="Fatura" />
										<f:selectItem itemLabel="Fatura / Duplicata"
											itemValue="Fatura / Duplicata" />
										<f:selectItem itemLabel="Nota Promissória"
											itemValue="Nota Promissória" />
										<f:selectItem itemLabel="Outros" itemValue="Outros" />
									</p:selectOneMenu></td>
							</tr>
							<tr>

								<td align="right"><h:outputLabel value="Forma De Pagamento" /></td>
								<td align="left"><p:selectOneMenu id="fomrPgto"
										value="#{contaPagarBean.lancamento.formaPagamento}">
										<f:selectItem itemLabel="Cartão de Crédito"
											itemValue="Cartão de Crédito" />
										<f:selectItem itemLabel="Cartão de Débito"
											itemValue="Cartão de Débito" />
										<f:selectItem itemLabel="Cheque" itemValue="Cheque" />
										<f:selectItem itemLabel="Crédito Proprio"
											itemValue="Crédito Proprio" />
										<f:selectItem itemLabel="Dinhero" itemValue="Dinhero" />
									</p:selectOneMenu></td>
							</tr>
							<tr>
								<td align="right"><h:outputLabel value="Frequencia: " /></td>
								<td align="left"><p:selectOneMenu id="frequencia"
										value="#{contaPagarBean.lancamento.frequencia}">
										<f:selectItem itemValue="Uma Única Vez"
											itemLabel="Uma Única Vez" />
										<f:selectItem itemValue="Diariamente" itemLabel="Diariamente" />
										<f:selectItem itemValue="Semanal" itemLabel="Semanal" />
										<f:selectItem itemValue="A Cada Dez Dias"
											itemLabel="A Cada Dez Dias" />
										<f:selectItem itemValue="A Cada 15 Dias"
											itemLabel="A Cada 15 Dias" />
										<f:selectItem itemValue="A Cada 28 Dias"
											itemLabel="A Cada 28 Dias" />
										<f:selectItem itemValue="Mensal" itemLabel="Mensal" />
										<f:selectItem itemValue="Bimestral" itemLabel="Bimestral" />
										<f:selectItem itemValue="Trimestral" itemLabel="Trimestral" />
										<f:selectItem itemValue="Quadrimestral"
											itemLabel="Quadrimestral" />
										<f:selectItem itemValue="Semestral" itemLabel="Semestral" />
										<f:selectItem itemValue="Anual" itemLabel="Anual" />
									</p:selectOneMenu></td>

							</tr>
						</table>
						<p:commandButton actionListener="#{contaPagarBean.salvar}"
							update="messages, tbl1, panelCad" />
					</h:panelGrid>
				</p:dialog>
				<!-- Fim Cadastro De Lançamento -->

				<!-- Começo Edição Lançamento -->
				<h:form id="form2">
					<p:dialog header="Editar Fornecedor" widgetVar="dlg2"
						resizable="false" width="850" height="600" modal="true"
						id="dialog2">
						<h:panelGrid id="panelEdit">
							<table>
								<tr>
									<td align="right"><h:outputLabel value="Documento: " /></td>
									<td align="left"><p:selectOneMenu id="documentoUpdate"
											value="#{contaPagarBean.lancamentoUpdate.documento}">
											<f:selectItem itemLabel="Boleto" itemValue="Boleto" />
											<f:selectItem itemLabel="Carnê" itemValue="Carnê" />
											<f:selectItem itemLabel="Cartaão de Crédito"
												itemValue="Cartão de Crédito" />
											<f:selectItem itemLabel="Cartão de Débito"
												itemValue="Cartão de Débito" />
											<f:selectItem itemLabel="Cheque" itemValue="Cheque" />
											<f:selectItem itemLabel="DARF" itemValue="DARF" />
											<f:selectItem itemLabel="Depósito Em Conta Corrente"
												itemValue="Depósito Em Conta Corrente" />
											<f:selectItem itemLabel="Dinheiro" itemValue="Dinheiro" />
											<f:selectItem itemLabel="Duplicata" itemValue="Duplicata" />
											<f:selectItem itemLabel="Débito Em Conta"
												itemValue="Débito Em Conta" />
											<f:selectItem itemLabel="Fatura" itemValue="Fatura" />
											<f:selectItem itemLabel="Fatura / Duplicata"
												itemValue="Fatura / Duplicata" />
											<f:selectItem itemLabel="Nota Promissória"
												itemValue="Nota Promissória" />
											<f:selectItem itemLabel="Outros" itemValue="Outros" />
										</p:selectOneMenu></td>
								</tr>
								<tr>

									<td align="right"><h:outputLabel
											value="Forma De Pagamento" /></td>
									<td align="left"><p:selectOneMenu id="formaPgtoUpdate"
											value="#{contaPagarBean.lancamentoUpdate.formaPagamento}">
											<f:selectItem itemLabel="Cartão de Crédito"
												itemValue="Cartão de Crédito" />
											<f:selectItem itemLabel="Cartão de Débito"
												itemValue="Cartão de Débito" />
											<f:selectItem itemLabel="Cheque" itemValue="Cheque" />
											<f:selectItem itemLabel="Crédito Proprio"
												itemValue="Crédito Proprio" />
											<f:selectItem itemLabel="Dinhero" itemValue="Dinhero" />
										</p:selectOneMenu></td>
								</tr>
								<tr>
									<td align="right"><h:outputLabel value="Frequencia: " /></td>
									<td align="left"><p:selectOneMenu id="frequencia"
											value="#{contaPagarBean.lancamentoUpdate.frequencia}">
											<f:selectItem itemValue="Uma Única Vez"
												itemLabel="Uma Única Vez" />
											<f:selectItem itemValue="Diariamente" itemLabel="Diariamente" />
											<f:selectItem itemValue="Semanal" itemLabel="Semanal" />
											<f:selectItem itemValue="A Cada Dez Dias"
												itemLabel="A Cada Dez Dias" />
											<f:selectItem itemValue="A Cada 15 Dias"
												itemLabel="A Cada 15 Dias" />
											<f:selectItem itemValue="A Cada 28 Dias"
												itemLabel="A Cada 28 Dias" />
											<f:selectItem itemValue="Mensal" itemLabel="Mensal" />
											<f:selectItem itemValue="Bimestral" itemLabel="Bimestral" />
											<f:selectItem itemValue="Trimestral" itemLabel="Trimestral" />
											<f:selectItem itemValue="Quadrimestral"
												itemLabel="Quadrimestral" />
											<f:selectItem itemValue="Semestral" itemLabel="Semestral" />
											<f:selectItem itemValue="Anual" itemLabel="Anual" />
										</p:selectOneMenu></td>



								</tr>
							</table>
							<p:commandButton action="#{contaPagarBean.atualizar}"
								ajax="false" />
						</h:panelGrid>
					</p:dialog>
				</h:form>
				<!-- Fim Edição Lançamento -->


			</p:panel>
		</div>
	</h:form>
	<style>
.ui-datatable .ui-datatable-data .even-row td {
	background-color: #F8F8F8;
	border-right: solid 0px #F8F8F8;
}

.ui-datatable .ui-datatable-data .odd-row td {
	background-color: #F0F0F0;
	border-right: solid 0px #F0F0F0;
}
</style>
</h:body>
</html>


5 Respostas

M

estrnanho se eu coloco

<?xml version="1.0" encoding="ISO-8859-1" ?>

o update funciona mais ai para o incluir

M

alguem?????

D

<p:commandButton action="#{contaPagarBean.atualizar}" ajax=“false” type=“Submit”/>

tenta assim abraço!!!

M

deu nao mais alguma ideia?

M

depois de muita dor de cabeça resolvi o problema… o negocio é que o itemValue não pode ter caracter especial

fod… viu

flw

Criado 15 de junho de 2012
Ultima resposta 16 de jun. de 2012
Respostas 5
Participantes 2