Hi Gili,

Thanks for finding the bug.

Enclosed is a patch which should solve it (at least for my test it does).

Please can you check.

Christian

On Mon, 15 Aug 2005 22:58:59 -0400, Gili <[EMAIL PROTECTED]> wrote:

Hi,

It looks like if you use a PageableDataView and pass in a IDataProvider into the constructor where that IDataProvider.size() returns zero, Wicket will throw:

wicket.markup.MarkupException: Markup element at index 39 failed to advance the markup stream [markup = file:/C:/Documents%20and%20Settings/Gili/My%20Documents/blueeye/trunk/desktopbeautifier/Server/netbeans4.2/build/web/WEB-INF/classes/desktopbeautifier/web/gallery/Page.html, index = 39, current = '<div wicket:id="imageRow" class="floatfix">' (line 22, column 11)]

because (my guess) no items end up getting generated. Should I open up an official bug report?

Gili



--
Christian Essl 
Index: RepeatingView.java
===================================================================
RCS file: 
/cvsroot/wicket-stuff/wicket-contrib-dataview/src/wicket/contrib/dataview/RepeatingView.java,v
retrieving revision 1.1
diff -u -r1.1 RepeatingView.java
--- RepeatingView.java  11 Aug 2005 20:54:48 -0000      1.1
+++ RepeatingView.java  16 Aug 2005 04:21:44 -0000
@@ -60,10 +60,13 @@
                final int markupStart = markupStream.getCurrentIndex();
 
                Iterator it = renderIterator();
-               while (it.hasNext())
-               {
-                       markupStream.setCurrentIndex(markupStart);
-                       renderItem((Component)it.next());
+               if(it.hasNext()){
+                       do{
+                               markupStream.setCurrentIndex(markupStart);
+                               renderItem((Component)it.next());
+                       }while(it.hasNext());
+               }else{
+                       markupStream.skipComponent();
                }
        }
 

Reply via email to