Author: dolander
Date: Tue Aug 31 15:20:36 2004
New Revision: 37264

Modified:
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java
Log:
The formatters and Attribute didn't work inside JSTL conditional tags because 
they looked only at their parents.
I generalized these tags to look for ancestors.



Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
       (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
       Tue Aug 31 15:20:36 2004
@@ -23,6 +23,7 @@
 
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
 
 /**
  * @jsptagref.tagdescription
@@ -127,7 +128,7 @@
             return;
         }
 
-        JspTag tag = getParent();
+        JspTag tag = 
SimpleTagSupport.findAncestorWithClass(this,IAttributeConsumer.class);
         if (!(tag instanceof IAttributeConsumer)) {
             String s = Bundle.getString("Tags_AttributeInvalidParent");
             registerTagError(s, null);

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java
      (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java
      Tue Aug 31 15:20:36 2004
@@ -22,6 +22,7 @@
 
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
 import java.text.DateFormat;
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
@@ -236,7 +237,7 @@
     public void doTag()
         throws JspException
     {
-        JspTag parentTag = getParent();
+        JspTag parentTag = 
SimpleTagSupport.findAncestorWithClass(this,Formattable.class);
 
         // if there are errors we need to either add these to the parent 
AbstractBastTag or report an error.
         if (hasErrors()) {

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
    Tue Aug 31 15:20:36 2004
@@ -21,6 +21,7 @@
 
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
 import java.text.DecimalFormat;
 import java.util.Locale;
 
@@ -158,7 +159,7 @@
     public void doTag()
         throws JspException
     {
-        JspTag parentTag = getParent();
+        JspTag parentTag = 
SimpleTagSupport.findAncestorWithClass(this,Formattable.class);
 
         // if there are errors we need to either add these to the parent 
AbstractBastTag or report an error.
         if (hasErrors()) {

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java
    Tue Aug 31 15:20:36 2004
@@ -22,6 +22,7 @@
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.Tag;
 import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
 
 //java imports
 
@@ -138,7 +139,7 @@
     public void doTag()
         throws JspException
     {
-        JspTag parentTag = getParent();
+        JspTag parentTag = 
SimpleTagSupport.findAncestorWithClass(this,Formattable.class);
 
         // if there are errors we need to either add these to the parent 
AbstractBastTag or report an error.
         if (hasErrors()) {

Reply via email to