You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Johnny Gonzalez <jo...@yahoo.es> on 2006/03/01 15:04:05 UTC

Losing buttons in datascroller page

Hello Everybody,

I'm trying to add dataScroller funcionality to a page
in which I have a list of elements, so I modified and
added all stuff related to the dataScroller, like in
the myfaces examples at Irian
(http://www.irian.at/myfaces/dataScroller.jsf), to my
JSP. 

The page with the list appears with the navigation
buttons (to go pages back or forward) The number of
pages appears ok, but when I click on next page for
example, all buttons for page navigation disappear,
and I cannot go back to the last page listing, the
only way is to press Back button in Mozilla :-(.

My JSP looks like this:

<h:panelGroup id="body">
						 <t:dataTable id="listaPaquetes" 
						   
value="#{AdministrarPaquetesBean.listaPaquetes}"
							var="lstPaquetesVar" 		            	    		     
              
							border="0"					
							headerClass="tableHeader"
							rowClasses="tableRow1,tableRow2"
							preserveDataModel="false"
			                rows="5">
								<h:column>
									<f:facet name="header">
										<f:verbatim>Nombre del Paquete</f:verbatim>
									</f:facet>
									<h:outputText
value="#{lstPaquetesVar.nombre}"/>
								</h:column>
								<h:column>
									<f:facet name="header">
										<f:verbatim>Producto</f:verbatim>
									</f:facet>
									<h:outputText value="Orientaciones Abogado"/>
									<f:verbatim><br></f:verbatim>									
									<h:outputText value="Orientaciones
Contador"/>
									<f:verbatim><br></f:verbatim>									
									<h:outputText value="InfoTrámites"/>
									<f:verbatim><br></f:verbatim>									
									<h:outputText value="Formatos de Documento"/>
								</h:column>
								<h:column>
									<f:facet name="header">
										<f:verbatim>Cantidad por
Producto</f:verbatim>
									</f:facet>
									<h:outputText
value="#{lstPaquetesVar.numeroOrientacionesAbogado}"/>
									<f:verbatim><br></f:verbatim>
									<h:outputText
value="#{lstPaquetesVar.numeroOrientacionesContador}"/>
									<f:verbatim><br></f:verbatim>									
									<h:outputText
value="#{lstPaquetesVar.numeroTramites}"/>
									<f:verbatim><br></f:verbatim>									
									<h:outputText
value="#{lstPaquetesVar.numeroFormatosDoc}"/>									
								</h:column>
								<h:column>
									<f:facet name="header">
										<f:verbatim>Valor</f:verbatim>
									</f:facet>
									<h:outputText 
									value="#{lstPaquetesVar.precio}"/>
								</h:column>
								<h:column>
									<f:facet name="header">
										<f:verbatim>Modificar</f:verbatim>
									</f:facet>
									 <h:commandLink
									 
actionListener="#{AdministrarPaquetesBean.selectPaquete}"
									  action="ModificarPaquete">
										<h:graphicImage value="images/editar.gif" 
											alt="Editar Paquete" 
											width="15%"
											style="border:0">										
										</h:graphicImage>
										 <f:param name="paqueteID" 
										 	value="#{lstPaquetesVar.id}"/>
									 </h:commandLink>
								</h:column>
						</t:dataTable>	
						
						 <h:panelGrid columns="1" >
				            <t:dataScroller id="scroll_1"
				                    for="listaPaquetes"
				                    fastStep="10"
				                    pageCountVar="pageCount"
				                    pageIndexVar="pageIndex"
				                    styleClass="scroller"
				                    paginator="true"
				                    paginatorMaxPages="9"
				                   
paginatorTableClass="paginator"
				                   
paginatorActiveColumnStyle="font-weight:bold;"
				                   
actionListener="#{AdministrarPaquetesBean.scrollerAction}"
				                    >
				                <f:facet name="first" >
				                    <t:graphicImage
url="images/arrow-first.gif" border="1" />
				                </f:facet>
				                <f:facet name="last">
				                    <t:graphicImage
url="images/arrow-last.gif" border="1" />
				                </f:facet>
				                <f:facet name="previous">
				                    <t:graphicImage
url="images/arrow-previous.gif" border="1" />
				                </f:facet>
				                <f:facet name="next">
				                    <t:graphicImage
url="images/arrow-next.gif" border="1" />
				                </f:facet>
				                <f:facet name="fastforward">
				                    <t:graphicImage
url="images/arrow-ff.gif" border="1" />
				                </f:facet>
				                <f:facet name="fastrewind">
				                    <t:graphicImage
url="images/arrow-fr.gif" border="1" />
				                </f:facet>
				            </t:dataScroller>
				           </h:panelGrid>
					    </h:panelGroup>


In my Bean (AdministrarPaquetesBean), I have added the
method that manages the navigation process, like this:


 public void scrollerAction(ActionEvent event)
	 {
		
	        ScrollerActionEvent scrollerEvent =
(ScrollerActionEvent)event;
	       
FacesContext.getCurrentInstance().getExternalContext().
	        log("scrollerAction: facet: " +
scrollerEvent.getScrollerfacet() + 
	        		", pageindex: " +
scrollerEvent.getPageIndex());
	       
	 }


I though it was because my Bean in the
faces-config.xml has "request" scope, so I changed it
to application, like in the examples, but its
behaviour is the same.

What could the problem be?

Thanks a lot,
Johnny




		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com