Hi It is a bug. Please create an issue here:
https://issues.apache.org/jira/browse/MYFACES I have already a patch, so as soon as you create the issue I'll commit it. Later, you can get a nightly build snapshot here: https://repository.apache.org/content/repositories/snapshots/org/apache/myfaces/core/ regards, Leonardo Uribe 2011/6/20 RICARD MORE FARRES <[email protected]>: > Hello, > > > > I am testing MyFaces 2.1.1 implemantation, in order to upgrade our > aplication from version 1.2.7. > > > > I have found a problem with parameters offset and size of ui:repeat tag. > > offset sets the first index of the list to iterate over. > > size is the number of element to iterate. > > > > If I have a list of Strings like this: > > private String[] textos = new String[] {"B1", "B2", "B3", "B4", "B5", "B6", > "B7"}; > > > > public String[] getTextos() { > > return textos; > > } > > > > And I declare repeat tag: > > <ui:repeat value="#{bean.textos}" var="texto" offset="0" size="1"> > > <h:outputText value="#{texto}"/><br/> > > </ui:repeat> > > > > It shows elements B1 and B2 (iterate over indexes 0 and 1). If I change > offset to 1, it will show elements B2 and B3. > > But if I set offset="2" in order to ietare over indexes 2 and 3 (elements B3 > and B4), I get an exception: > > > > javax.faces.FacesException: iteration offset cannot be greater than > collection size > > at > org.apache.myfaces.view.facelets.component.UIRepeat._validateAttributes(UIRepeat.java:552) > > at > org.apache.myfaces.view.facelets.component.UIRepeat.process(UIRepeat.java:581) > > … > > > > If I want to avoid this error, size must be allways greater tha offset, but > it should be possible to iterate over last two elements of a 102 elements > list starting from index 100, for example (offset=100,size=1). > > And should not be “1” the lower value for size? Now, if you set 0 to size, > ui:repeat iterates once… > > > > Thanks in advance, > > Ricard > > > > > > Para el medioambiente cada gesto cuenta: por favor, no imprimas este e-mail > si no es realmente necesario. > > Este correo y sus archivos asociados son privados y confidenciales y va > dirigido exclusivamente a su destinatario. Si recibe este correo sin ser el > destinatario del mismo,le rogamos proceda a su eliminación y lo ponga en > conocimiento del emisor. La difusión por cualquier medio del contenido de > este correo podría ser sancionada conforme a lo previsto en las leyes > españolas. No se autoriza la utilización con fines comerciales o para su > incorporación a ficheros automatizados de las direcciones del emisor o del > destinatario. > > Each one of us can do our bit for the environment: please, do not print this > e-mail unless it is absolutely essential. > > This e-mail and its attached files are confidential and are exclusively > intented for their addressees. If you have received this e-mail and it is > not addressed to you, please notify us of the error by replying to it before > proceeding to delete it. The diffusion of the contents of this e-mail by > whatever means may be penalised in accordance with Spanish law. The > utilisation of the addresses of the sender and the addressee for commercial > purposes or for inclusion on computer files is not authorized. >
