beehive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekon...@apache.org
Subject svn commit: rev 46256 - in incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui: databinding/datagrid/model databinding/datagrid/rendering/impl tags/databinding/datagrid
Date Fri, 17 Sep 2004 15:10:33 GMT
Author: ekoneil
Date: Fri Sep 17 08:10:32 2004
New Revision: 46256

Modified:
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/AbstractPagerRenderer.java
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/PreviousNextPagerRenderer.java
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java
Log:
Various fixes related to configuring a data grid pager:

- the pageAction should render it's specified.
- the pageAction needs to have its action-url type specified in the TLDX
- the pager shouldn't render when there is no page URI specified.  it's got to know where
to go.  could default to the current request URI; can do that if feedback warrants that.

BB: self
DRT: NetUI pass
BVT: NetUI pass




Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
Fri Sep 17 08:10:32 2004
@@ -82,6 +82,7 @@
     public String getPageAction() {return _pageAction;}
     public void setPageAction(String pageAction) {_pageAction = pageAction;}
 
+    // todo: what needs to happen here with re-writing the URI when it's an HREF?
     public String getPageUri()
     {
         String pageUri = null;
@@ -89,6 +90,10 @@
         {
             PageContext pageContext = JspUtil.getPageContext(_model.getJspContext());
             pageUri = PageflowTagUtils.createActionURL(pageContext, _pageAction);
+        }
+        else if(_pageHref != null)
+        {
+            pageUri = _pageHref;
         }
 
         return pageUri;

Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/AbstractPagerRenderer.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/AbstractPagerRenderer.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/AbstractPagerRenderer.java
Fri Sep 17 08:10:32 2004
@@ -22,6 +22,10 @@
 import org.apache.beehive.netui.databinding.datagrid.model.PagerModel;
 import org.apache.beehive.netui.databinding.datagrid.model.DataGridModel;
 import org.apache.beehive.netui.databinding.datagrid.rendering.IPagerRenderer;
+import org.apache.beehive.netui.databinding.datagrid.util.JspUtil;
+import org.apache.beehive.netui.pageflow.util.PageflowTagUtils;
+
+import javax.servlet.jsp.PageContext;
 
 /**
  * todo: lots of i18n here
@@ -47,6 +51,15 @@
     public PagerModel getPagerModel() {return _pagerModel;}
 
     public DataGridModel getDataGridModel() {return _gridModel;}
+
+    public String getPageUri()
+    {
+        String uri = _pagerModel.getPageUri();
+
+        if(uri == null)
+            throw new IllegalStateException("Can not render a pager with a null page URI.");
+        else return uri;
+    }
 
     public String render()
     {

Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/PreviousNextPagerRenderer.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/PreviousNextPagerRenderer.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/rendering/impl/PreviousNextPagerRenderer.java
Fri Sep 17 08:10:32 2004
@@ -51,12 +51,7 @@
         buf.append(lastPage);
         buf.append("  ");
 
-        String pageUri = pagerModel.getPageHref();
-        if(pageUri != null)
-        {
-            PageContext pageContext = JspUtil.getPageContext(gridModel.getJspContext());
-            pageUri = PageflowTagUtils.createActionURL(pageContext, pageUri);
-        }
+        String pageUri = pagerModel.getPageUri();
 
         if(pagerModel.getPreviousPage() > 0)
             buildLivePreviousLink(buf, pagerService, pageUri);

Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java
Fri Sep 17 08:10:32 2004
@@ -42,7 +42,7 @@
 
     private Integer _pageSize = null;
     private String _pagerStyle = null;
-    private String _pageUri = null;
+    private String _pageHref = null;
     private String _pageAction = null;
 
     public String getTagName()
@@ -75,7 +75,7 @@
       *
       * @netui:attribute required="false" rtexprvalue="true"
       */
-    public void setPageHref(String pageUri) {_pageUri = pageUri;}
+    public void setPageHref(String pageHref) {_pageHref = pageHref;}
 
     /**
      * @jsptagref.attributedescription
@@ -83,6 +83,7 @@
      * @jsptagref.attributesyntaxvalue <i>String_pageAction</i>
      *
      * @netui:attribute required="false" rtexprvalue="true"
+     * @netui.tldx:attribute category="general" reftype="netui-action-url"
      */
     public void setPageAction(String pageAction) {_pageAction = pageAction;}
 
@@ -110,11 +111,14 @@
                 dgm.setPagerRenderer(pagerRenderer);
             }
 
-            if(_pageUri != null && _pageAction != null)
+            if(_pageHref != null && _pageAction != null)
                 throw new JspException("The configurePager tag can't set both the pageAction
and pageHref attributes");
 
-            if(_pageUri != null)
-                pm.setPageHref(_pageUri);
+            if(_pageHref == null && _pageAction == null)
+                throw new JspException("The configurePager tag requires one of the pageAction
or pageHref attributes in order to render a pager link.");
+
+            if(_pageHref != null)
+                pm.setPageHref(_pageHref);
 
             if(_pageAction != null)
                 pm.setPageAction(_pageAction);

Mime
View raw message