You could give the following a try.

<span jwcid="@If"
condition="ognl:components.table.tableRow.creationDate
!= null">

   <span jwcid="createDateFormat"/>

</span>

The documentation on the If component is at  
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/If.html

Shing

--- Manuel Thurn <[EMAIL PROTECTED]> wrote:

> Thank you very much for your answer. 
> 
> I realized that my attempt to format a null Date was
> the reason for the
> exception. Without the formatting component (with
> the id
> "creationDateFormat") an empty string is displayed. 
> 
> Despite the possible drawback I'd like to try your
> suggestion. I would be
> very happy if someone gave me a hint how to code the
> If component in
> combination with the ognl syntax to catch the null
> Date.
> 
> Here again the mentioned code snippet:
> <component id="creationDateFormat" type="Insert">
>       <binding name="value"
>
value="components.table.tableRow.creationDate.time"/>
>       <binding name="format" value="dateFormat"/>
> </component>
> 
> Manuel   
> 
> -----Original Message-----
> From: Shing Hing Man [mailto:[EMAIL PROTECTED] 
> Sent: Freitag, 23. Juni 2006 06:53
> To: Tapestry users
> Subject: Re: Null Date in a Contrib:Table
> 
> Have you consider wrapping your component 
> 'creationDateFormat' with an If component - so that
> the date is only rendered if it is not null ?
> 
> There might be a drawback with the above approach.
> The
> default sorting on your date column might not work.
>  
> Shing
> 
> 
> --- Manuel Thurn <[EMAIL PROTECTED]> wrote:
> 
> > Hi!
> > 
> >  
> > 
> > For a project I want to display a list of objects
> in
> > an html table. I'm
> > using the Table component of the contrib library
> of
> > Tapestry. One column
> > should show a formatted Date (or Calendar) object.
> > It works fine as long as
> > the Date is not null. But if the database contains
> > objects with null values
> > I get the following Exception:
> > 
> >  
> > 
> > Unable to read OGNL expression.:  source is null
> for
> > getProperty(null,
> > "tableRow")
> > 
> >  
> > 
> > Here is a snippet of the .page file. creationDate
> is
> > a Calendar object. To
> > format it I get the Date with getTime() and use
> the
> > format parameter of the
> > Insert component.
> > 
> >  
> > 
> > <component id="campaignTable"
> type="Contrib:Table">
> > 
> > <binding name="source" value="dataItems"/>
> > 
> > <binding name="columns" value="literal:name,
> > description, creationDate"/>
> > 
> > </component>
> > 
> >  
> > 
> > <component id="creationDateFormat" type="Insert">
> > 
> > <binding name="value"
> >
>
value="components.table.tableRow.creationDate.time"/>
> > 
> > <binding name="format" value="dateFormat"/>
> > 
> > </component>
> > 
> >  
> > 
> > I would be happy if you could help me find a way
> to
> > handle this exception.
> > 
> >  
> > 
> > Thanks,
> > 
> >  
> > 
> > Manuel
> > 
> >  
> > 
> > 
> 
> 
> Home page :
>   http://uk.geocities.com/matmsh/index.html
> 
> 
>               
>
___________________________________________________________
> 
> Try the all-new Yahoo! Mail. "The New Version is
> radically easier to use" -
> The Wall Street Journal 
> http://uk.docs.yahoo.com/nowyoucan.html
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 

Home page :
  http://uk.geocities.com/matmsh/index.html


                
___________________________________________________________ 
Copy addresses and emails from any email account to Yahoo! Mail - quick, easy 
and free. http://uk.docs.yahoo.com/trueswitch2.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to