Rich:DataScroller não muda de página

1 resposta
J

Pessoal ja usei o dataScroller do richfaces várias vezes e nunca tive problemas, mas estou tendo um grande problema agora, ele traz o resultado paginado certinho mas simplesmente não muda de página.

A dataTable e o dataScroller estão dentro de um modalPanel, mas fora do modalPanel também não funciona.

Segue o código abaixo, o dataScroller está na linha 173.

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

<jsp:root xmlns:jsp  ="http://java.sun.com/JSP/Page"
		  xmlns:c    ="http://java.sun.com/jsp/jstl/core"
		  xmlns:fn	 ="http://java.sun.com/jsp/jstl/functions"
		  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:rich ="http://richfaces.org/rich"
		  xmlns:a4j  ="http://richfaces.org/a4j"
		  xmlns      ="http://www.w3.org/1999/xhtml" version="2.0">


	<f:subview id="trajetosDetalhes">	

		<div style="width:1230px">
			<div style="float:left;width:500px">
			
				<a4j:form id="formRota">

					<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
						<tr>
							<td style="height:25px;text-align:right;padding-right:5px;width:127px">
								Titulo da Rota:
							</td>
							<td style="height: 25px">
								<h:inputText id="txtDescricao" value="#{trajetosDetalhes.rota.tituloRot}" style="width: 283px" />
							</td>
						</tr>
						<tr>
							<td></td>
							<td>
								<input id="btnAdcNovoPonto" type="button" value="Adicionar Ponto de Controle" style="width: 190px" onclick="javascript:Modal('abrir')" />
							</td>
						</tr>
						<tr>
							<td colspan="2" style="padding-top:7px;padding-left:5px;padding-bottom:7px;">

								<rich:dataTable id="lstPontoRota" rows="10" width="488px" 
												onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
												onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
												rendered="true" cellpadding="0" cellspacing="0" border="0" sortMode="multiple"
												var="pontoRota" value="#{trajetosDetalhes.listaPontos}"> 

									<f:facet name="header">
										<h:outputText value="Pontos de Controle da Rota" />
									</f:facet>

									<rich:column width="50px" style="text-align:left" sortBy="#{pontoRota.ordemPro}">
										<f:facet name="header">
											<h:outputText id="ordem" value="Ordem"/>
										</f:facet>
										<h:outputText id="ordemPro" value="#{pontoRota.ordemPro}" />
									</rich:column>

									<rich:column width="100px" style="text-align:left" sortBy="#{pontoRota.pontoControle.tituloPco}">
										<f:facet name="header">
											<h:outputText id="pontoControle" value="Ponto de Controle" />
										</f:facet>
										<h:outputText id="tituloPco" value="#{(fn:length(pontoRota.pontoControle.tituloPco) > 17) ? fn:join(fn:substring(pontoRota.pontoControle.tituloPco, 0, 17), '...') : pontoRota.pontoControle.tituloPco}" escape="false"/>
									</rich:column>

									<rich:column width="300px" style="text-align:left" sortBy="#{pontoRota.pontoControle.enderecoPco}">
										<f:facet name="header">
											<h:outputText id="endereco" value="Endereco" />
										</f:facet>
										<h:outputText id="enderecoPco" value="#{(fn:length(pontoRota.pontoControle.enderecoPco) > 46) ? fn:join(fn:substring(pontoRota.pontoControle.enderecoPco, 0, 46), '...') : pontoRota.pontoControle.enderecoPco}" escape="false"/>
									</rich:column>

									<rich:column width="20px">
										<f:facet name="header">
											<h:outputText id="excluirPro" value="" />
										</f:facet>
										<a4j:commandLink actionListener="#{trajetosDetalhes.removerPontoControle}">
											<h:graphicImage id="imgDel" url="imagens/btlDelete.png" style="border:0" />
											<f:param id="ordemDel" name="ordemDel" value="#{pontoRota.ordemPro}" />
											<a4j:support event="onclick" reRender="lstPontoRota" immediate="true" ajaxSingle="true" oncomplete="ReloadRota()" />
										</a4j:commandLink>
									</rich:column>

								</rich:dataTable>

							</td>
						</tr>
						<tr>
							<td colspan="2">
								<table border="0" cellpadding="0" cellspacing="0" style="width: 400px">
									<tr>
										<td style="width: 122px; height: 25px; text-align: right; padding-right: 5px">Distância:</td>
										<td style="width: 278px"><b><div id="distancia"></div></b></td>
									</tr>
									<tr>
										<td style="width: 122px; height: 25px; text-align: right; padding-right: 5px">Tempo Estimado:</td>
										<td style="width: 278px"><b><div id="tempo"></div></b></td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td colspan="2" style="height:25px;padding-top:8px;text-align:center">				               
								<h:commandButton type="button" id="btnSalvar" value="Salvar Rota" onclick="return SalvarRota()" action="#{controlAbasMonitoramento.renderTrajetosListagem}" actionListener="#{trajetosDetalhes.salvarRota}" />
								&#160;<h:commandButton id="btnCancelar" value="Cancelar" action="#{controlAbasMonitoramento.renderTrajetosListagem}" /> 
							</td>
						</tr>
					</table>
					
				</a4j:form>

			</div>
			<div style="float:left;width:730px">
				<div id="map_rotas" style="width:723px;height:630px;margin-left:5px"></div>
			</div>
		</div>

		

		<a4j:form id="modalForm">

			<a4j:jsFunction name="reRenderLista" reRender="lstPontoRota" immediate="true" />

			<rich:modalPanel id="mpPontosControle" minWidth="700" width="700" minHeight="355" height="355" zindex="1000">
				<fieldset>
					<legend>Pontos de Controle</legend>
					<center>
					
						<rich:dataTable id="lstPontosControle" rows="5" width="650px"
										onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
										onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
										rendered="true" cellpadding="0" cellspacing="0" border="0" sortMode="multiple"
										var="ponto" value="#{pontosControleDetalhes.listaPontoControle}">

							<f:facet name="header">
								<h:outputText value="Listagem de Pontos de Controle" />
							</f:facet>

							<rich:column width="100px" style="text-align:left" sortBy="#{ponto.tituloPco}">
								<f:facet name="header">
									<h:outputText value="Título" />
								</f:facet>
								<h:outputText title="#{ponto.tituloPco}" value="#{(fn:length(ponto.tituloPco) > 17) ? fn:join(fn:substring(ponto.tituloPco, 0, 17), '...') : ponto.tituloPco}" />
							</rich:column>

							<rich:column width="300px" style="text-align:left" sortBy="#{ponto.enderecoPco}">
								<f:facet name="header">
									<h:outputText value="Endereço" />
								</f:facet>
								<h:outputText title="#{ponto.enderecoPco}" value="#{(fn:length(ponto.enderecoPco) > 52) ? fn:join(fn:substring(ponto.enderecoPco, 0, 52), '...') : ponto.enderecoPco}" />
							</rich:column>

							<rich:column width="72px" style="text-align:center" sortBy="#{ponto.latitudePco}">
								<f:facet name="header">
									<h:outputText value="Latitude" />
								</f:facet>
								<h:outputText value="#{ponto.latitudePco}" />
							</rich:column>

							<rich:column width="72px" style="text-align:center" sortBy="#{ponto.longitudePco}">
								<f:facet name="header">
									<h:outputText value="Longitude" />
								</f:facet>
								<h:outputText value="#{ponto.longitudePco}" />
							</rich:column>						

							<rich:column width="20px" style="text-align:center" sortBy="">
								<f:facet name="header">
									<h:outputText value="" />
								</f:facet>
								<input type="radio" id="rdSel_#{ponto.idPco}" name="groupRad" value="#{ponto.idPco}" />
							</rich:column>
						</rich:dataTable>

						<br />
						<rich:datascroller for="lstPontosControle" maxPages="5" renderIfSinglePage="false" />

						<br />
						<table border="0" cellpadding="0" cellspacing="0" style="width: 300px">
							<tr>
								<td style="width: 60px; height: 25px; text-align: right; padding-right: 5px">
									Ordem:
								</td>
								<td>
									<input id="txtOrdem" type="text" style="width:30px" maxlength="2" />		                            
								</td>
							</tr>
						</table>

						<br />
						<input type="button" id="btnAdicionarPonto" value="Adicionar Ponto" onclick="javascript:AssociarPonto()" />&#160;	
						<input type="button" id="btnCancelar" value="Cancelar" onclick="javascript:Modal('fechar')" />

					</center>
				</fieldset>
			</rich:modalPanel>

		</a4j:form>

	</f:subview>
</jsp:root>

1 Resposta

CrazyFrogJava

Cara tentar fazer o seguinte, defina um id no Scroller e renderuza ele em suas ações.

=]

Criado 24 de agosto de 2009
Ultima resposta 24 de ago. de 2009
Respostas 1
Participantes 2