Hola a Todos:

With this patch, Portlet Browser now has Next and Prev buttons working..

Saludos ,
Ignacio J. Ortega
Index: src/java/org/apache/jetspeed/modules/actions/portlets/RegistryBrowseAction.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/RegistryBrowseAction.java,v
retrieving revision 1.2
diff -u -r1.2 RegistryBrowseAction.java
--- src/java/org/apache/jetspeed/modules/actions/portlets/RegistryBrowseAction.java    
 2001/07/29 13:41:52     1.2
+++ src/java/org/apache/jetspeed/modules/actions/portlets/RegistryBrowseAction.java    
+ 2001/10/08 22:38:12
@@ -94,23 +94,23 @@
 
         int size = Integer.parseInt(pageSize);
 
-        int next = start+size;
-        int prev = start-size;
-                
+        int next = start+size+1;
+        int prev = start-size-1;
+
         String regName = portlet.getPortletConfig()
                                 .getInitParameter("registry",Registry.PORTLET);
 
         Iterator i = Registry.get(regName).listEntryNames();
         Vector entries = new Vector();
-        
+
         int count = 0;
 
         while(i.hasNext() && (count < next) )
         {
             String name = (String)i.next();
-            
+
             RegistryEntry regEntry = Registry.getEntry(regName,name);
-    
+
             if ( (regEntry!=null) && (!regEntry.isHidden()) )
             {
                 if (count >= start)
@@ -120,13 +120,13 @@
                 count++;
             }
         }
-                    
+
         context.put("registry", entries);
         if (start > 0)
         {
             context.put("prev",String.valueOf(prev));
         }
-        if (    (count == next-1) 
+        if (    (count == next )
              && ( count < Registry.get(regName).getEntryCount() ) )
         {
             context.put("next",String.valueOf(next));
cvs server: Diffing webapp/WEB-INF/templates/vm/portlets/html
Index: webapp/WEB-INF/templates/vm/portlets/html/browser-portlet.vm
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/browser-portlet.vm,v
retrieving revision 1.1
diff -u -r1.1 browser-portlet.vm
--- webapp/WEB-INF/templates/vm/portlets/html/browser-portlet.vm        2001/06/25 
11:33:51     1.1
+++ webapp/WEB-INF/templates/vm/portlets/html/browser-portlet.vm        2001/10/08 
+22:38:12
@@ -1,4 +1,3 @@
-<form action="$jlink" method="post">
 <table width="100%" cellpadding="0" cellspacing="0">
   <tr>
     <th>Name</th>
@@ -27,14 +26,19 @@
   <tr>
     <td align="right" width="50%">
 #if ($prev)
+<form action="$jlink" method="post">
       <input type="submit" value="&lt; &lt; Previous">
+      <input type="hidden" name="start" value="$prev">
+</form>
 #end
     </td>
     <td align="left" width="50%">
-#if ($prev)
+#if ($next)
+<form action="$jlink" method="post">
       <input type="submit" value="Next &gt; &gt;">
+      <input type="hidden" name="start" value="$next">
+</form>
 #end
     </td>
   </tr>
 </table>
-</form>
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to