Problema na chamada do action do commandButton

0 respostas
D

Boa noite a todos!

estou enfrentando um problema numa chamada ao ACTION de um . num commandButton fora de um panel ele chama o método action, mas dentro, não está sendo possivel. Segue o código
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<ui:param name="controle" value="#{controleFotoImovel}" />

	<a4j:form >

		<h:panelGrid columns="1">
			<rich:fileUpload rendered="true" id="pgUpload"
				fileUploadListener="#{controleFotoImovel.listener}"
				listWidth="#{controleFotoImovel.listWidth}" listHeight="0"
				autoclear="true"
				maxFilesQuantity="#{controleFotoImovel.uploadsAvailable}"
				immediateUpload="#{controleFotoImovel.autoUpload}"
				acceptedTypes="jpg, gif, png, bmp"
				allowFlash="#{controleFotoImovel.useFlash}"
				addControlLabel="Adicionar Foto" uploadControlLabel="Carregar"
				cancelEntryControlLabel="Cancelar"
				clearAllControlLabel="Limpar Tudo" clearControlLabel="Limpar"
				doneLabel="Carregado" sizeErrorLabel="Tamanho Incorreto"
				transferErrorLabel="Erro na Tranferência" progressLabel="Progresso"
				stopControlLabel="Parar" stopEntryControlLabel="Parar">
				<a4j:support event="onuploadcomplete" reRender="info, pgUpload" />
				<f:facet name="label">
					<h:outputText value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}" />
				</f:facet>
			</rich:fileUpload>

			<h:panelGroup id="info">
				<rich:panel bodyClass="info">
					<f:facet name="header">
						<h:outputText value="Fotos" />
					</f:facet>
					<h:outputText value="Sem fotos carregadas"
						rendered="#{controleFotoImovel.size==0}" />

					<rich:dataGrid id="dgDados" columns="2"
						value="#{controleFotoImovel.fi}" var="file" rowKeyVar="row">
						<rich:panel bodyClass="rich-laguna-panel-no-header"
							style="height:80px; align:center">
							<h:panelGrid columns="3" style="align:center">

								<a4j:mediaOutput element="img" mimeType="image/jpeg"
									createContent="#{controleFotoImovel.paint}" value="#{row}"
									style="width:50px; height:50px;" cacheable="false" />

								<a4j:outputPanel ajaxRendered="true">
									<h:panelGrid id="pgDados" columns="4"
										rendered="#{controleFotoImovel.edita}">
										<h:outputText value="Nome:" />
										<h:outputText value="#{file.fileName}" />
										<h:outputText value="" />
										<h:outputText value="" />
										<h:outputText value="Descrição:" />
										<h:outputText value="#{file.dsFoto}" />
										<h:outputText value="" />
										<h:outputText value="" />
										<h:outputText value="Destaque:" />
										<h:panelGrid columns="5">
											<h:selectBooleanCheckbox value="#{file.tpDestaque}" />
											<rich:spacer width="10" />
											<h:outputText value="Ativo:" />
											<rich:spacer width="4" />
											<h:selectBooleanCheckbox value="#{file.tpAtivo}" />
										</h:panelGrid>
										<a4j:commandLink value="Salvar"
											action="#{controleFotoImovel.salvaFoto }" />
									</h:panelGrid>
								</a4j:outputPanel>
								<a4j:region>

									<h:panelGrid columns="1">
										<rich:spacer height="10" />
										<a4j:commandLink value="Limpar" />
										<rich:spacer height="10" />

<!--  **********       neste command a chamada do action e/ou action listener NÃO é feita normalmente   ***********-->

										<a4j:commandButton reRender="info" value="Editar"  action="#{controleFotoImovel.editaFoto}"/>
									</h:panelGrid>

								</a4j:region>

							</h:panelGrid>
							<h:outputText value="#{file.length} KB" />
						</rich:panel>
					</rich:dataGrid>
				</rich:panel>
				<rich:spacer height="3" />
				<br />

<!--  **********       neste command a chamada do action e/ou action listener é feita normalmente   ***********-->

				<a4j:commandButton action="#{controleFotoImovel.clearUploadData}"
					reRender="info, upload" value="Limpar tudo"
					rendered="#{controleFotoImovel.size>0}" />
			</h:panelGroup>
		</h:panelGrid>
	</a4j:form>
Criado 9 de fevereiro de 2010
Respostas 0
Participantes 1