You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "Eddie O'Neil (JIRA)" <be...@incubator.apache.org> on 2005/04/21 21:44:26 UTC
[jira] Updated: (BEEHIVE-481) support repeater padding when ignoreNulls is set, the pad exists, and the data structure is full of nulls
[ http://issues.apache.org/jira/browse/BEEHIVE-481?page=all ]
Eddie O'Neil updated BEEHIVE-481:
---------------------------------
type: Improvement (was: Bug)
Summary: support repeater padding when ignoreNulls is set, the pad exists, and the data structure is full of nulls (was: repeater broken when ignoreNulls is true, a pad is used, and the data structure is full of nulls)
Version: V1
(was: V1Beta)
Fix Version: TBD
(was: V1)
After looking at this for a while, I'm reclassifying this as an improvement rather than a bug. The problem is that the repeater *can't* handle the case where ignoreNulls is true, a <pad> is used, and the data structure is all nulls. Without prior knowledge of whether the repeater is rendering in "structured" or "unstructured" mode, the repeater must render its body at least once. In "unstructured", though, this can lead to expression errors because "container.item" expressions could evaluate against null objects.
So, without adding an extra attribute to the repeater that will signal whether to render the body to force padding, the repeater can't support this case simply by changing the current implementation.
Currently, the behavior is that if the repeater encounters this case, it will render exactly nothing. If the defaultText attribute is non-null, the defaultText String will render.
I'd be happy to make this change if there's sufficient interest in having it done; if that need exists, let me know.
> support repeater padding when ignoreNulls is set, the pad exists, and the data structure is full of nulls
> ---------------------------------------------------------------------------------------------------------
>
> Key: BEEHIVE-481
> URL: http://issues.apache.org/jira/browse/BEEHIVE-481
> Project: Beehive
> Type: Improvement
> Components: NetUI
> Versions: V1
> Reporter: Eddie O'Neil
> Assignee: Eddie O'Neil
> Priority: Minor
> Fix For: TBD
>
> Repro:
> render this repeater with a non-null array that is full of nulls. This should render the padding 10 times but instead renders nothing.
> This is really an edge case for using the repeater, but it's not outrageous that this situation could come up.
> ::::: repro.jsp
> <%
> String[] array = new String[10];
> pageContext.setAttribute("array", array);
> %>
> <b>ignoreNulls=true, padContext (min=10)</b><br/>
> <netui-data:repeater dataSource="pageScope.array" ignoreNulls="true">
> <netui-data:repeaterHeader>
> <table class="tablebody" border="1">
> <tr><td>Start Table</td></tr>
> </netui-data:repeaterHeader>
> <netui-data:repeaterItem>
> <tr>
> <td><netui:span value="${container.item}" defaultValue=" "></netui:span></td>
> </tr>
> </netui-data:repeaterItem>
> <netui-data:repeaterFooter>
> <tr><td>End Table</td></tr>
> </table>
> </netui-data:repeaterFooter>
> <netui-data:pad minRepeat="10">
> <tr><td><netui:span value="Pad text: ${container.index}"/></td></tr>
> </netui-data:pad>
> </netui-data:repeater>
> :::::
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira