You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2006/01/11 15:43:11 UTC

svn commit: r368029 - in /beehive/trunk/netui/src: tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java util/org/apache/beehive/netui/util/netui.properties

Author: ekoneil
Date: Wed Jan 11 06:43:08 2006
New Revision: 368029

URL: http://svn.apache.org/viewcvs?rev=368029&view=rev
Log:
Two fixes for the NetUI data binding tags:

- BEEHIVE-1036 NPE when netui-data Cell tags are not contained within a grid
- fix a message in netui.properties that still referenced a tag that doesn't exist.

BB: self
Test: NetUI BVT pass


Modified:
    beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
    beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties

Modified: beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java?rev=368029&r1=368028&r2=368029&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java (original)
+++ beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java Wed Jan 11 06:43:08 2006
@@ -21,6 +21,7 @@
 
 import java.io.IOException;
 import javax.servlet.jsp.JspException;
+import javax.servlet.ServletException;
 
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
@@ -95,6 +96,10 @@
         throws JspException, IOException {
 
         DataGridTagModel dataGridModel = DataGridUtil.getDataGridTagModel(getJspContext());
+        if(dataGridModel == null) {
+            String s = Bundle.getString("Tags_DataGrid_MissingDataGridModel", new Object[]{getTagName()});
+            throw new JspException(s);
+        }
 
         int gridRenderState = dataGridModel.getRenderState();
 
@@ -102,9 +107,11 @@
         if(gridRenderState == DataGridTagModel.RENDER_STATE_START) {
             return;
         }
-        // otherwise, the CellModel associated with this tag
-        // needs to be fetched from the <cell> tag for the current
-        // iteration
+        /*
+        otherwise, the CellModel associated with this tag
+        needs to be fetched from the <cell> tag for the current
+        iteration
+        */
         else {
             CellModel model = internalGetCellModel();
             model.setDataGridTagModel(dataGridModel);
@@ -194,7 +201,7 @@
         }
 
         // it's not legal to set the id or name attributes this way
-        if(name != null && (name.equals(HtmlConstants.ID) || name.equals(HtmlConstants.NAME))) {
+        if(name.equals(HtmlConstants.ID) || name.equals(HtmlConstants.NAME)) {
             String s = Bundle.getString("Tags_AttributeMayNotBeSet", new Object[]{name});
             throw new JspException(s);
         }

Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties?rev=368029&r1=368028&r2=368029&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties (original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties Wed Jan 11 06:43:08 2006
@@ -659,7 +659,7 @@
 Tags_DeclarePageInput_EmptyType=The type attribute of the declarePageInput tag can not be an empty string.
 Tags_DeclarePageInput_Required=The page input "{0}" is required for this page and was not found.
 Tags_GetData_valueExpressionError=The expression "<b>{0}</b>" is an invalid expression for the <b>value</b> attribute.  Expressions in the value attribute must bind to a single object.
-Tags_MethodParameter_invalidParent=The MethodParamter tag must be directly contained inside of a CallControl, CallPageFlow, or ChoiceMethod tag.
+Tags_MethodParameter_invalidParent=The MethodParamter tag must be directly contained inside of a CallMethod or CallPageFlow tag.
 Tags_MethodParameter_undefinedValue=The MethodParameter tag must have either the isNull attribute set to true or the value attribute set to a valid value.";
 Tags_Pad_intTooSmall=Can not use a value of \"{0}\" for the field \"{1}\"; the value must be greater than zero.
 Tags_Pad_minRepeatIntTooSmall=Can not use a value of \"{0}\" for the field \"{1}\"; the value must be greater than or equal to zero.
@@ -702,6 +702,7 @@
 DataGridFilter_NoFilterOperation=Can not determine the operation for a filter with filter expression \"{0}\"
 DataGridFilter_UnknownFilterOperation=Can not include the filter with operation \"{0}\" in a SQL statement; the operation is unknown
 FilterTypeHint_UnknownHintString=The filter type hint \"{0}\" is not recognized as a valid type hint
+Tags_DataGrid_MissingDataGridModel=Unable to locate data grid in cell of type {0}.  Is this cell contained inside of a dataGrid tag?
 
 #
 # Utility Strings
@@ -720,4 +721,4 @@
 TypeUtils_javaSqlTimestampConvertError=Caught an error converting a String to a java.sql.Timestamp: {0}
 TypeUtils_javaSqlTimeConvertError=Caught an error converting a String to a java.sql.Time: {0}
 URLCodec_encodeException=Caught exception encoding a String.  Cause: {0}
-URLCodec_decodeException=Caught exception decoding a String.  Cause: {0}
+URLCodec_decodeException=Caught exception decoding a String.  Cause: {0}
\ No newline at end of file