CSpHtml.reset() gets rid of the Html stuff generated so far, but if you do:
================
CSpHtml.reset();
load("pgEmpty")
return(STOP);
================
on the Repeated1_... event, ND goes ahead and creates HTML stuff for
whatever is there on the Page, after the repeated. The result is the proper
HTML for pgEmpty appended with whatever was on the original page after the
Repeated1 plus the ending tags - </TABLE> </BODY>, </HTML> etc. - a mess.
If you don't want to go manual, what you can do is on the Repeated1_..
event, when 0 records, set a flag and return (STOP)
Inside this_onBeforeHtmlOutput(..), check for this flag and do:
CSpHtml.reset();
load("pgEmpty")
Aby
> -----Original Message-----
> From: Curt Springer [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, April 29, 1999 5:19 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [ND] event order question
>
> You can flush the html output stream, somebody else chime in as to exact
> command, actually, I think you have to execute 2 similar 'flush' commands.
>
> I tend to go manual:
> -- unbind fields from do
> -- unbind do from page
> -- this_onBeforeDisplayEvent:
> ----execute dataobject, if not succeeded die or something
> ----if num rows <= 0 load 'empty' page.
> -- Repeated1_onBeforeRowDisplayEvent
> ---- int rowindex = event.getRowIndex()
> ---- if rowindex >= do num rows (might have to execute getLastResults),
> return STOP
> ---- for each formerly bound field, execute getValue on do or last results
> set, using rowindex as row argument, apply result
> to setValue on field.
>
> -- Curt Springer, Team ND
>
>
> At 03:46 PM 4/29/99 -0500, Kevin D. Owen wrote:
> >I have a question concerning the following scenario:
> >
> >I have a page showing records from a database in a repeated. As normal,
> the
> >table displaying the records has headers and the normal table data rows.
> If
> >no rows are found I want to load a "no rows" page instead. I place a
> check
> >for "getNumOfRows()" in the "onAfterDataObjectExecute" event for the
> >repeated (Repeated1_onAfterDataObjectExecuteEvent) and if <= 0, call
> >pgEmpty.load(). The probem is this...by the time the
> >"onAfterDataObjectExecute" event is fired for the repeated, the
> >onBeforeDisplay for the page has already executed, thus when I load the
> >pgEmpty it is shown appended to the top part of the original page
> (including
> >the tables headers before the repeated). How can I check the num rows
> for
> >the repeated in time to NOT display anything from the main page (ie
> >onBeforeDisplayEvent fires before the onAfterDataObjectExecuteEvent)...or
> >how can I load pgEmpty completely on top of pgMain? Any ideas?
> >
> >Kevin
> >
> >
> >
> >
> >_________________________________________________________________________
> >
> >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]
_________________________________________________________________________
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]