You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by "Burgess, Benjamin" <BB...@tiaa-cref.org> on 2007/07/11 17:46:30 UTC

Data Grid with null rows

I am using a netui-data:dataGrid tag to iterate over an ArrayList object
which has some null elements in it.  This results in some of the rows
printing "null" to the screen in its columns.  Is there a way to tell
the dataGrid to ignore null elements when iterating?  I could use the
renderRows="false" on the "rows" tag, and then put an if around a "row"
tag inside, but this makes the odd even row counter get messed up.  Is
there some other way?  Maybe filters?

 

Ben


********************************************************************************************
This message, including any attachments, contains confidential information intended 
for a specific individual and purpose, and is protected by law. If you are not the intended 
recipient, please contact the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of this message, or
the taking of any action based on it, is strictly prohibited.

TIAA-CREF
********************************************************************************************

Re: Data Grid with null rows

Posted by Eddie O'Neil <ek...@gmail.com>.
Ben--

  Today, there's not a way to suppress null items in a data set as
there is with the Repeater.  This is definitely an oversight;
ignoreNulls should be part of the data grid.

  Obviously, I don't know the structure of your application, but it
might be possible to wrap the ArrayList in a List facade that just
ignores null items.

  Please add an enhancement request to support some kind of null
supression.  Thanks.

Cheers,
Eddie


On 7/12/07, Burgess, Benjamin <BB...@tiaa-cref.org> wrote:
> Thanks for the link.  This will help make the null looks prettier when
> printed, but it wont prevent their iteration.
>
> What I am really looking for is an "ignoreNulls=true" like there is on
> the netui-data:repeater tag.  Unfortunately, it does not exist for the
> datagrid tag.
>
> I looked at the code, and it would take a little bit of refactoring of
> some of the classes which use code like the following:
>
>                     int index = dataGridModel.getCurrentIndex();
>                     if(index % 2 == 0)
>                         trState.styleClass = styleModel.getRowClass();
>                     else trState.styleClass =
> styleModel.getAltRowClass();
>
> This is because, if a NULL element is ignored, the index would still be
> incremented, but the odd/even row rendering should keep track of which
> style to use next.  Basically, the logic of keeping track of odd/even
> style class needs to be separated from the actual index into the
> datasource.
>
> Ben
>
> -----Original Message-----
> From: Scott Hammer [mailto:shammer@bea.com]
> Sent: Wednesday, July 11, 2007 2:30 PM
> To: Burgess, Benjamin; Beehive Users
> Subject: RE: Data Grid with null rows
>
> Ben,
>
> If you are using BEA WebLogic, the weblogic.xml deployment descriptor
> has a setting to print null as the empty string.  Look for "print-nulls"
> under the following URL:
>
> http://e-docs.bea.com/wls/docs100/webapp/weblogic_xml.html#wp1038491
>
> If not using WebLogic, you will likely need add logic to check for null.
>
> HTH,
> Scott
>
> -----Original Message-----
> From: Burgess, Benjamin [mailto:BBurgess@tiaa-cref.org]
> Sent: Wednesday, July 11, 2007 11:47 AM
> To: user@beehive.apache.org
> Subject: Data Grid with null rows
>
> I am using a netui-data:dataGrid tag to iterate over an ArrayList object
> which has some null elements in it.  This results in some of the rows
> printing "null" to the screen in its columns.  Is there a way to tell
> the dataGrid to ignore null elements when iterating?  I could use the
> renderRows="false" on the "rows" tag, and then put an if around a "row"
> tag inside, but this makes the odd even row counter get messed up.  Is
> there some other way?  Maybe filters?
>
>
>
> Ben
>
>
> ************************************************************************
> ********************
> This message, including any attachments, contains confidential
> information intended for a specific individual and purpose, and is
> protected by law. If you are not the intended recipient, please contact
> the sender immediately by reply e-mail and destroy all copies.
> You are hereby notified that any disclosure, copying, or distribution of
> this message, or the taking of any action based on it, is strictly
> prohibited.
>
> TIAA-CREF
> ************************************************************************
> ********************
>
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
>
> ********************************************************************************************
> This message, including any attachments, contains confidential information intended
> for a specific individual and purpose, and is protected by law. If you are not the intended
> recipient, please contact the sender immediately by reply e-mail and destroy all copies.
> You are hereby notified that any disclosure, copying, or distribution of this message, or
> the taking of any action based on it, is strictly prohibited.
>
> TIAA-CREF
> ********************************************************************************************
>

RE: Data Grid with null rows

Posted by "Burgess, Benjamin" <BB...@tiaa-cref.org>.
Thanks for the link.  This will help make the null looks prettier when
printed, but it wont prevent their iteration.

What I am really looking for is an "ignoreNulls=true" like there is on
the netui-data:repeater tag.  Unfortunately, it does not exist for the
datagrid tag.

I looked at the code, and it would take a little bit of refactoring of
some of the classes which use code like the following:

                    int index = dataGridModel.getCurrentIndex();
                    if(index % 2 == 0)
                        trState.styleClass = styleModel.getRowClass();
                    else trState.styleClass =
styleModel.getAltRowClass();

This is because, if a NULL element is ignored, the index would still be
incremented, but the odd/even row rendering should keep track of which
style to use next.  Basically, the logic of keeping track of odd/even
style class needs to be separated from the actual index into the
datasource.

Ben

-----Original Message-----
From: Scott Hammer [mailto:shammer@bea.com] 
Sent: Wednesday, July 11, 2007 2:30 PM
To: Burgess, Benjamin; Beehive Users
Subject: RE: Data Grid with null rows

Ben,

If you are using BEA WebLogic, the weblogic.xml deployment descriptor
has a setting to print null as the empty string.  Look for "print-nulls"
under the following URL:

http://e-docs.bea.com/wls/docs100/webapp/weblogic_xml.html#wp1038491 

If not using WebLogic, you will likely need add logic to check for null.

HTH,
Scott

-----Original Message-----
From: Burgess, Benjamin [mailto:BBurgess@tiaa-cref.org] 
Sent: Wednesday, July 11, 2007 11:47 AM
To: user@beehive.apache.org
Subject: Data Grid with null rows

I am using a netui-data:dataGrid tag to iterate over an ArrayList object
which has some null elements in it.  This results in some of the rows
printing "null" to the screen in its columns.  Is there a way to tell
the dataGrid to ignore null elements when iterating?  I could use the
renderRows="false" on the "rows" tag, and then put an if around a "row"
tag inside, but this makes the odd even row counter get messed up.  Is
there some other way?  Maybe filters?

 

Ben


************************************************************************
********************
This message, including any attachments, contains confidential
information intended for a specific individual and purpose, and is
protected by law. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of
this message, or the taking of any action based on it, is strictly
prohibited.

TIAA-CREF
************************************************************************
********************

Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

********************************************************************************************
This message, including any attachments, contains confidential information intended 
for a specific individual and purpose, and is protected by law. If you are not the intended 
recipient, please contact the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of this message, or
the taking of any action based on it, is strictly prohibited.

TIAA-CREF
********************************************************************************************

RE: Data Grid with null rows

Posted by Scott Hammer <sh...@bea.com>.
Ben,

If you are using BEA WebLogic, the weblogic.xml deployment descriptor
has a setting to print null as the empty string.  Look for "print-nulls"
under the following URL:

http://e-docs.bea.com/wls/docs100/webapp/weblogic_xml.html#wp1038491 

If not using WebLogic, you will likely need add logic to check for null.

HTH,
Scott

-----Original Message-----
From: Burgess, Benjamin [mailto:BBurgess@tiaa-cref.org] 
Sent: Wednesday, July 11, 2007 11:47 AM
To: user@beehive.apache.org
Subject: Data Grid with null rows

I am using a netui-data:dataGrid tag to iterate over an ArrayList object
which has some null elements in it.  This results in some of the rows
printing "null" to the screen in its columns.  Is there a way to tell
the dataGrid to ignore null elements when iterating?  I could use the
renderRows="false" on the "rows" tag, and then put an if around a "row"
tag inside, but this makes the odd even row counter get messed up.  Is
there some other way?  Maybe filters?

 

Ben


************************************************************************
********************
This message, including any attachments, contains confidential
information intended for a specific individual and purpose, and is
protected by law. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of
this message, or the taking of any action based on it, is strictly
prohibited.

TIAA-CREF
************************************************************************
********************

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.