> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, April 22, 1999 10:18 AM
> To: [EMAIL PROTECTED]
> Subject: [ND] not only redirect
>
> Hello,
>
> I designed a search page CustomerSearch and a result page
> CustomerSearchResult. The DataObject is doSomeQuery.
> In the CustomerSearchResult page there is Date field which has the format
> of "dd/mm/yyyy", I did the formatting in
> date_onBeforeDisplayEvent(CSpDisplayEvent) using the following sentences:
> try {
> CSpDatetime datetime =
> getDisplayFieldValue("theDateField").datetimeValue();
> setDisplayFieldValue("thDateField", new
> CSpString(datetime.format("dd/mm/yyyy")));
> } catch (CSpDatetimeParsingException e) { }
>
> With the above sentences, I got NullPointerException when conducting a
> search that does not hit the database. The reason
> is since no rows returns the value of datetime will be null, then problem
> arises when calling datetime.format().
>>>>
> To fix it, in the
> this_onAfterDataObjectExecuteEvent(CSpDataDrivenVisualEvent event) I
> redirect it to another page by calling
> somePage.load(). But this load will trigger onBeforeDisplayEvent, so still
> I got the NullPointerException. <<<<
>
Why not simply use the good old 'if' to check for null and skip
further action?
Aby
> Could anybody give me a solution?
>
> Thanks in advance,
> -Fujian
>
> _________________________________________________________________________
>
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
> For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]