From: Grant on
I am using the method CellDoubleClick() in a browser window to choose
a customer and then open another browser with only that customer's
data. I would like to close the 1st browser as soon as the control
goes to the 2nd window. I have tried to Close() the window, Destroy()
the bbrowser and a few other techniques but failed. the code for the
CellDoubleClick() is as follows:
METHOD CellDoubleClick(oControlEvent) CLASS dtwJobBrowser
LOCAL oServer AS OBJECT
LOCAL odbsJob AS DBServer
LOCAL odtwJob AS dtwJob
LOCAL cFilter AS STRING

cFilter := NULL_STRING

oServer := oControlEvent:Control:Server
cFilter := oServer:FIELDGET( #NAME )

odbsJob := MyServerArray[2]
odtwJob := dtwJob{self:Owner,,,{self,true, cFilter}}
odtwJob:Show()
The target window opens fine but I don't want the initial browser
window left behind especially after the 2nd browser closes. Any help
will be appreciated.
Thank you
From: Kevin on
Grant,

What you could try is creating a method on the Owner and pass it the
filter and get it to open the new window. Then call the EndWindow of the
original method.

Hope this helps.

Kevin

"Grant" <grantd(a)dunsmoreinfo.com> wrote in message
news:3fe24c19-67fa-42f6-89e0-2fc26b789fb9(a)z13g2000prh.googlegroups.com:

> I am using the method CellDoubleClick() in a browser window to choose
> a customer and then open another browser with only that customer's
> data. I would like to close the 1st browser as soon as the control
> goes to the 2nd window. I have tried to Close() the window, Destroy()
> the bbrowser and a few other techniques but failed. the code for the
> CellDoubleClick() is as follows:
> METHOD CellDoubleClick(oControlEvent) CLASS dtwJobBrowser
> LOCAL oServer AS OBJECT
> LOCAL odbsJob AS DBServer
> LOCAL odtwJob AS dtwJob
> LOCAL cFilter AS STRING
>
> cFilter := NULL_STRING
>
> oServer := oControlEvent:Control:Server
> cFilter := oServer:FIELDGET( #NAME )
>
> odbsJob := MyServerArray[2]
> odtwJob := dtwJob{self:Owner,,,{self,true, cFilter}}
> odtwJob:Show()
> The target window opens fine but I don't want the initial browser
> window left behind especially after the 2nd browser closes. Any help
> will be appreciated.
> Thank you

From: John Martens on
If the dtwJob window is a dialog-window it will wait for odtwJob:Show()
to end and the continue in the CellDoubleClick( method. You cannot do
anything else than wait until that happens.

If the second window is a non modal window adding SELF:EndWindow() after
odtwJob:Show() should close the first one and leaves only the second one
visible.

John




Op 9-6-2010 20:40, Grant schreef:
> I am using the method CellDoubleClick() in a browser window to choose
> a customer and then open another browser with only that customer's
> data. I would like to close the 1st browser as soon as the control
> goes to the 2nd window. I have tried to Close() the window, Destroy()
> the bbrowser and a few other techniques but failed. the code for the
> CellDoubleClick() is as follows:
> METHOD CellDoubleClick(oControlEvent) CLASS dtwJobBrowser
> LOCAL oServer AS OBJECT
> LOCAL odbsJob AS DBServer
> LOCAL odtwJob AS dtwJob
> LOCAL cFilter AS STRING
>
> cFilter := NULL_STRING
>
> oServer := oControlEvent:Control:Server
> cFilter := oServer:FIELDGET( #NAME )
>
> odbsJob := MyServerArray[2]
> odtwJob := dtwJob{self:Owner,,,{self,true, cFilter}}
> odtwJob:Show()
> The target window opens fine but I don't want the initial browser
> window left behind especially after the 2nd browser closes. Any help
> will be appreciated.
> Thank you
From: Grant on
On Jun 9, 11:53 am, John Martens <adsl672...(a)tiscali.nl> wrote:
> If the dtwJob window is a dialog-window it will wait for odtwJob:Show()
> to end and the continue in the CellDoubleClick( method. You cannot do
> anything else than wait until that happens.
>
> If the second window is a non modal window adding SELF:EndWindow() after
> odtwJob:Show() should close the first one and leaves only the second one
> visible.
>
> John
>
> Op 9-6-2010 20:40, Grant schreef:
>
>
>
> > I am using the method CellDoubleClick() in a browser window to choose
> > a customer and then open another browser with only that customer's
> > data. I would like to close the 1st browser as soon as the control
> > goes to the 2nd window. I have tried to Close() the window, Destroy()
> > the bbrowser and a few other techniques but failed. the code for the
> > CellDoubleClick() is as follows:
> > METHOD CellDoubleClick(oControlEvent) CLASS dtwJobBrowser
> >    LOCAL oServer AS OBJECT
> >    LOCAL odbsJob AS DBServer
> >    LOCAL odtwJob AS dtwJob
> >    LOCAL cFilter AS STRING
>
> >    cFilter := NULL_STRING
>
> >    oServer := oControlEvent:Control:Server
> >    cFilter := oServer:FIELDGET( #NAME )
>
> >    odbsJob := MyServerArray[2]
> >    odtwJob := dtwJob{self:Owner,,,{self,true, cFilter}}
> >    odtwJob:Show()
> > The target window opens fine but I don't want the initial browser
> > window left behind especially after the 2nd browser closes. Any help
> > will be appreciated.
> > Thank you- Hide quoted text -
>
> - Show quoted text -

Wow. It was that simple. I used your method John and added
SELF:EndWindow() and it works fine.
I was looking for something more complicated and never thought of that
even though I have used it often before.

Thanks again