Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

datawindow parameter passing

11 posts in DataWindow Last posting was on 2008-10-29 17:24:04.0Z
Sharon Posted on 2008-10-28 16:57:12.0Z
Sender: 785d.49060a70.1804289383@sybase.com
From: sharon
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: datawindow parameter passing
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49074468.1ea4.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 28 Oct 2008 08:57:12 -0800
X-Trace: forums-1-dub 1225213032 10.22.241.41 (28 Oct 2008 08:57:12 -0800)
X-Original-Trace: 28 Oct 2008 08:57:12 -0800, 10.22.241.41
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88054
Article PK: 417309

using pb 11.5
Can I pass a datawindow using openwithparm & closewithparm?

in response window
closewithparm(this,dw_task)

in calling window
dw_task = message.powerobjectparm
messagebox('rc',string(dw_task.rowcount()))


I am getting a null object reference
What am I doing wrong?


Chris Pollach Posted on 2008-10-28 17:23:13.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49074468.1ea4.1681692777@sybase.com>
Subject: Re: datawindow parameter passing
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49074a81$1@forums-1-dub>
Date: 28 Oct 2008 09:23:13 -0800
X-Trace: forums-1-dub 1225214593 10.22.241.152 (28 Oct 2008 09:23:13 -0800)
X-Original-Trace: 28 Oct 2008 09:23:13 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88055
Article PK: 417312

Hi Sharon;

Yes ... absolutely, you can pass any object type as a reference that
way.

Are you sure that the window you are opening is actually saved as a
"Response" dialog? If not, that would entirely break the use of the
Open/CloseWithParm scenario and the "PowerObjectParm" could easily be
reused/reset - thus ending in a Null Object error.

Is the Message.PowerObjectParm assignment being done right after the
OpenWithParm ( ) method call?

--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com

<sharon> wrote in message news:49074468.1ea4.1681692777@sybase.com...
> using pb 11.5
> Can I pass a datawindow using openwithparm & closewithparm?
>
> in response window
> closewithparm(this,dw_task)
>
> in calling window
> dw_task = message.powerobjectparm
> messagebox('rc',string(dw_task.rowcount()))
>
>
> I am getting a null object reference
> What am I doing wrong?


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-10-28 17:46:38.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49074a81$1@forums-1-dub> <49074c15.1f6e.1681692777@sybase.com>
Subject: Re: datawindow parameter passing
Lines: 77
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49074ffe$2@forums-1-dub>
Date: 28 Oct 2008 09:46:38 -0800
X-Trace: forums-1-dub 1225215998 10.22.241.152 (28 Oct 2008 09:46:38 -0800)
X-Original-Trace: 28 Oct 2008 09:46:38 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88058
Article PK: 417314

That's because objects are always passed by reference, and after the
CloseWithParm, back in the calling window, the response window is already
destroyed!
What I have done in a similar situation is define an instance variable in
the response window DataWindow i_pass_dw
In the open event of the response window
Blob bl_pass
i_pass_dw = message.powerobjectparm
// a local variable would vanish when the script completes,
// and the Message object is subject to reuse
bl_pass = i_pass_dw.GetFullState()
dw_task.SetFullState (bl_pass)

To close the response window, if the user selected cancel, just Close(this)
If the user selected Save/OK
Blob bl_changes
dw_task.GetChanges (bl_changes)
i_pass_dw.SetChanges (bl_changes)
// applies changes to the passed reference DW - it remains in the main
window's unit of work
Close(this)
// or CloseWithReturn if you have other data to send back

<sharon> wrote in message news:49074c15.1f6e.1681692777@sybase.com...
>> Hello, yes I am sure the window is of type response.
> after the response window closes, the pass back to the main
> window does not work. I get the null object referenct.
>
> in calling window
> openwithparm(w_response, dw_task)
>
> in response
> dw_task = message.powerobjectparm
>
> the above works fine, the reverse with the closewithparm
> does not.
>
>
> Hi Sharon;
>>
>> Yes ... absolutely, you can pass any object type as a
>> reference that way.
>>
>> Are you sure that the window you are opening is
>> actually saved as a "Response" dialog? If not, that would
>> entirely break the use of the Open/CloseWithParm scenario
>> and the "PowerObjectParm" could easily be reused/reset -
>> thus ending in a Null Object error.
>>
>> Is the Message.PowerObjectParm assignment being done
>> right after the OpenWithParm ( ) method call?
>>
>> --
>> Regards ... Chris
>> ISUG - NA RUG Director
>> http://chrispollach.pbdjmagazine.com
>>
>>
>> <sharon> wrote in message
>> > news:49074468.1ea4.1681692777@sybase.com... using pb
>> > 11.5 Can I pass a datawindow using openwithparm &
>> closewithparm? >
>> > in response window
>> > closewithparm(this,dw_task)
>> >
>> > in calling window
>> > dw_task = message.powerobjectparm
>> > messagebox('rc',string(dw_task.rowcount()))
>> >
>> >
>> > I am getting a null object reference
>> > What am I doing wrong?
>>
>>


Sharon Posted on 2008-10-29 13:01:05.0Z
Sender: 785d.49060a70.1804289383@sybase.com
From: Sharon
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Thanks! this worked Re: datawindow parameter passing
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49085e91.4190.1681692777@sybase.com>
References: <49074ffe$2@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 29 Oct 2008 05:01:05 -0800
X-Trace: forums-1-dub 1225285265 10.22.241.41 (29 Oct 2008 05:01:05 -0800)
X-Original-Trace: 29 Oct 2008 05:01:05 -0800, 10.22.241.41
Lines: 77
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88065
Article PK: 417319


> That's because objects are always passed by reference, and
> after the CloseWithParm, back in the calling window, the
> response window is already destroyed!
> What I have done in a similar situation is define an
> instance variable in the response window DataWindow
> i_pass_dw In the open event of the response window
> Blob bl_pass
> i_pass_dw = message.powerobjectparm
> // a local variable would vanish when the script completes
> , // and the Message object is subject to reuse
> bl_pass = i_pass_dw.GetFullState()
> dw_task.SetFullState (bl_pass)
>
> To close the response window, if the user selected cancel,
> just Close(this) If the user selected Save/OK
> Blob bl_changes
> dw_task.GetChanges (bl_changes)
> i_pass_dw.SetChanges (bl_changes)
> // applies changes to the passed reference DW - it remains
> in the main window's unit of work
> Close(this)
> // or CloseWithReturn if you have other data to send back
>
>
> <sharon> wrote in message
> news:49074c15.1f6e.1681692777@sybase.com... >> Hello, yes
> > I am sure the window is of type response. after the
> > response window closes, the pass back to the main window
> does not work. I get the null object referenct. >
> > in calling window
> > openwithparm(w_response, dw_task)
> >
> > in response
> > dw_task = message.powerobjectparm
> >
> > the above works fine, the reverse with the closewithparm
> > does not.
> >
> >
> > Hi Sharon;
> >>
> >> Yes ... absolutely, you can pass any object type
> as a >> reference that way.
> >>
> >> Are you sure that the window you are opening is
> >> actually saved as a "Response" dialog? If not, that
> would >> entirely break the use of the Open/CloseWithParm
> scenario >> and the "PowerObjectParm" could easily be
> reused/reset - >> thus ending in a Null Object error.
> >>
> >> Is the Message.PowerObjectParm assignment being
> done >> right after the OpenWithParm ( ) method call?
> >>
> >> --
> >> Regards ... Chris
> >> ISUG - NA RUG Director
> >> http://chrispollach.pbdjmagazine.com
> >>
> >>
> >> <sharon> wrote in message
> >> > news:49074468.1ea4.1681692777@sybase.com... using pb
> >> > 11.5 Can I pass a datawindow using openwithparm &
> >> closewithparm? >
> >> > in response window
> >> > closewithparm(this,dw_task)
> >> >
> >> > in calling window
> >> > dw_task = message.powerobjectparm
> >> > messagebox('rc',string(dw_task.rowcount()))
> >> >
> >> >
> >> > I am getting a null object reference
> >> > What am I doing wrong?
> >>
> >>
>
>


Sharon Posted on 2008-10-29 15:34:45.0Z
Sender: 785d.49060a70.1804289383@sybase.com
From: Sharon
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Oops one problem Re: datawindow parameter passing
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49088295.49e2.1681692777@sybase.com>
References: <49074ffe$2@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 29 Oct 2008 07:34:45 -0800
X-Trace: forums-1-dub 1225294485 10.22.241.41 (29 Oct 2008 07:34:45 -0800)
X-Original-Trace: 29 Oct 2008 07:34:45 -0800, 10.22.241.41
Lines: 87
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88067
Article PK: 417322

Jerry,
I used this approach all seemed to work well.
However if I delete a row from the data window in the
response window, it shows a rowcount of say 2 rows, which is
correct.
After returning to the calling window the rowcount says 3
rows & the deleted row is still there.
Any ideas?

> That's because objects are always passed by reference, and
> after the CloseWithParm, back in the calling window, the
> response window is already destroyed!
> What I have done in a similar situation is define an
> instance variable in the response window DataWindow
> i_pass_dw In the open event of the response window
> Blob bl_pass
> i_pass_dw = message.powerobjectparm
> // a local variable would vanish when the script completes
> , // and the Message object is subject to reuse
> bl_pass = i_pass_dw.GetFullState()
> dw_task.SetFullState (bl_pass)
>
> To close the response window, if the user selected cancel,
> just Close(this) If the user selected Save/OK
> Blob bl_changes
> dw_task.GetChanges (bl_changes)
> i_pass_dw.SetChanges (bl_changes)
> // applies changes to the passed reference DW - it remains
> in the main window's unit of work
> Close(this)
> // or CloseWithReturn if you have other data to send back
>
>
> <sharon> wrote in message
> news:49074c15.1f6e.1681692777@sybase.com... >> Hello, yes
> > I am sure the window is of type response. after the
> > response window closes, the pass back to the main window
> does not work. I get the null object referenct. >
> > in calling window
> > openwithparm(w_response, dw_task)
> >
> > in response
> > dw_task = message.powerobjectparm
> >
> > the above works fine, the reverse with the closewithparm
> > does not.
> >
> >
> > Hi Sharon;
> >>
> >> Yes ... absolutely, you can pass any object type
> as a >> reference that way.
> >>
> >> Are you sure that the window you are opening is
> >> actually saved as a "Response" dialog? If not, that
> would >> entirely break the use of the Open/CloseWithParm
> scenario >> and the "PowerObjectParm" could easily be
> reused/reset - >> thus ending in a Null Object error.
> >>
> >> Is the Message.PowerObjectParm assignment being
> done >> right after the OpenWithParm ( ) method call?
> >>
> >> --
> >> Regards ... Chris
> >> ISUG - NA RUG Director
> >> http://chrispollach.pbdjmagazine.com
> >>
> >>
> >> <sharon> wrote in message
> >> > news:49074468.1ea4.1681692777@sybase.com... using pb
> >> > 11.5 Can I pass a datawindow using openwithparm &
> >> closewithparm? >
> >> > in response window
> >> > closewithparm(this,dw_task)
> >> >
> >> > in calling window
> >> > dw_task = message.powerobjectparm
> >> > messagebox('rc',string(dw_task.rowcount()))
> >> >
> >> >
> >> > I am getting a null object reference
> >> > What am I doing wrong?
> >>
> >>
>
>


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-10-29 15:53:11.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49074ffe$2@forums-1-dub> <49088295.49e2.1681692777@sybase.com>
Subject: Re: Oops one problem Re: datawindow parameter passing
Lines: 93
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <490886e7@forums-1-dub>
Date: 29 Oct 2008 07:53:11 -0800
X-Trace: forums-1-dub 1225295591 10.22.241.152 (29 Oct 2008 07:53:11 -0800)
X-Original-Trace: 29 Oct 2008 07:53:11 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88068
Article PK: 417323

Did you apply the changes from the response window DW to the calling window
DW before closing the response window?

<Sharon> wrote in message news:49088295.49e2.1681692777@sybase.com...
> Jerry,
> I used this approach all seemed to work well.
> However if I delete a row from the data window in the
> response window, it shows a rowcount of say 2 rows, which is
> correct.
> After returning to the calling window the rowcount says 3
> rows & the deleted row is still there.
> Any ideas?
>
>
>> That's because objects are always passed by reference, and
>> after the CloseWithParm, back in the calling window, the
>> response window is already destroyed!
>> What I have done in a similar situation is define an
>> instance variable in the response window DataWindow
>> i_pass_dw In the open event of the response window
>> Blob bl_pass
>> i_pass_dw = message.powerobjectparm
>> // a local variable would vanish when the script completes
>> , // and the Message object is subject to reuse
>> bl_pass = i_pass_dw.GetFullState()
>> dw_task.SetFullState (bl_pass)
>>
>> To close the response window, if the user selected cancel,
>> just Close(this) If the user selected Save/OK
>> Blob bl_changes
>> dw_task.GetChanges (bl_changes)
>> i_pass_dw.SetChanges (bl_changes)
>> // applies changes to the passed reference DW - it remains
>> in the main window's unit of work
>> Close(this)
>> // or CloseWithReturn if you have other data to send back
>>
>>
>> <sharon> wrote in message
>> news:49074c15.1f6e.1681692777@sybase.com... >> Hello, yes
>> > I am sure the window is of type response. after the
>> > response window closes, the pass back to the main window
>> does not work. I get the null object referenct. >
>> > in calling window
>> > openwithparm(w_response, dw_task)
>> >
>> > in response
>> > dw_task = message.powerobjectparm
>> >
>> > the above works fine, the reverse with the closewithparm
>> > does not.
>> >
>> >
>> > Hi Sharon;
>> >>
>> >> Yes ... absolutely, you can pass any object type
>> as a >> reference that way.
>> >>
>> >> Are you sure that the window you are opening is
>> >> actually saved as a "Response" dialog? If not, that
>> would >> entirely break the use of the Open/CloseWithParm
>> scenario >> and the "PowerObjectParm" could easily be
>> reused/reset - >> thus ending in a Null Object error.
>> >>
>> >> Is the Message.PowerObjectParm assignment being
>> done >> right after the OpenWithParm ( ) method call?
>> >>
>> >> --
>> >> Regards ... Chris
>> >> ISUG - NA RUG Director
>> >> http://chrispollach.pbdjmagazine.com
>> >>
>> >>
>> >> <sharon> wrote in message
>> >> > news:49074468.1ea4.1681692777@sybase.com... using pb
>> >> > 11.5 Can I pass a datawindow using openwithparm &
>> >> closewithparm? >
>> >> > in response window
>> >> > closewithparm(this,dw_task)
>> >> >
>> >> > in calling window
>> >> > dw_task = message.powerobjectparm
>> >> > messagebox('rc',string(dw_task.rowcount()))
>> >> >
>> >> >
>> >> > I am getting a null object reference
>> >> > What am I doing wrong?
>> >>
>> >>
>>
>>


Sharon Posted on 2008-10-29 17:00:06.0Z
Sender: 785d.49060a70.1804289383@sybase.com
From: Sharon
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Oops one problem Re: datawindow parameter passing
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49089696.4dfa.1681692777@sybase.com>
References: <490886e7@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 29 Oct 2008 09:00:06 -0800
X-Trace: forums-1-dub 1225299606 10.22.241.41 (29 Oct 2008 09:00:06 -0800)
X-Original-Trace: 29 Oct 2008 09:00:06 -0800, 10.22.241.41
Lines: 99
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88071
Article PK: 417327

Yes, I did
Works ok for adds & changes, but not deletes.
I pass this datawindow back & forth from the calling &
response.
>

Did you apply the changes from the response window DW to

> the calling window DW before closing the response window?
>
> <Sharon> wrote in message
> > news:49088295.49e2.1681692777@sybase.com... Jerry,
> > I used this approach all seemed to work well.
> > However if I delete a row from the data window in the
> > response window, it shows a rowcount of say 2 rows,
> > which is correct.
> > After returning to the calling window the rowcount says
> > 3 rows & the deleted row is still there.
> > Any ideas?
> >
> >
> >> That's because objects are always passed by reference,
> and >> after the CloseWithParm, back in the calling
> window, the >> response window is already destroyed!
> >> What I have done in a similar situation is define an
> >> instance variable in the response window DataWindow
> >> i_pass_dw In the open event of the response window
> >> Blob bl_pass
> >> i_pass_dw = message.powerobjectparm
> >> // a local variable would vanish when the script
> completes >> , // and the Message object is subject to
> reuse >> bl_pass = i_pass_dw.GetFullState()
> >> dw_task.SetFullState (bl_pass)
> >>
> >> To close the response window, if the user selected
> cancel, >> just Close(this) If the user selected Save/OK
> >> Blob bl_changes
> >> dw_task.GetChanges (bl_changes)
> >> i_pass_dw.SetChanges (bl_changes)
> >> // applies changes to the passed reference DW - it
> remains >> in the main window's unit of work
> >> Close(this)
> >> // or CloseWithReturn if you have other data to send
> back >>
> >>
> >> <sharon> wrote in message
> >> news:49074c15.1f6e.1681692777@sybase.com... >> Hello,
> yes >> > I am sure the window is of type response. after
> the >> > response window closes, the pass back to the main
> window >> does not work. I get the null object referenct.
> > >> > in calling window
> >> > openwithparm(w_response, dw_task)
> >> >
> >> > in response
> >> > dw_task = message.powerobjectparm
> >> >
> >> > the above works fine, the reverse with the
> closewithparm >> > does not.
> >> >
> >> >
> >> > Hi Sharon;
> >> >>
> >> >> Yes ... absolutely, you can pass any object
> type >> as a >> reference that way.
> >> >>
> >> >> Are you sure that the window you are opening is
> >> >> actually saved as a "Response" dialog? If not, that
> >> would >> entirely break the use of the
> Open/CloseWithParm >> scenario >> and the
> "PowerObjectParm" could easily be >> reused/reset - >>
> thus ending in a Null Object error. >> >>
> >> >> Is the Message.PowerObjectParm assignment being
> >> done >> right after the OpenWithParm ( ) method call?
> >> >>
> >> >> --
> >> >> Regards ... Chris
> >> >> ISUG - NA RUG Director
> >> >> http://chrispollach.pbdjmagazine.com
> >> >>
> >> >>
> >> >> <sharon> wrote in message
> >> >> > news:49074468.1ea4.1681692777@sybase.com... using
> pb >> >> > 11.5 Can I pass a datawindow using openwithparm
> & >> >> closewithparm? >
> >> >> > in response window
> >> >> > closewithparm(this,dw_task)
> >> >> >
> >> >> > in calling window
> >> >> > dw_task = message.powerobjectparm
> >> >> > messagebox('rc',string(dw_task.rowcount()))
> >> >> >
> >> >> >
> >> >> > I am getting a null object reference
> >> >> > What am I doing wrong?
> >> >>
> >> >>
> >>
> >>
>
>


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-10-29 17:18:50.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <490886e7@forums-1-dub> <49089696.4dfa.1681692777@sybase.com>
Subject: Re: Oops one problem Re: datawindow parameter passing
Lines: 105
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49089afa@forums-1-dub>
Date: 29 Oct 2008 09:18:50 -0800
X-Trace: forums-1-dub 1225300730 10.22.241.152 (29 Oct 2008 09:18:50 -0800)
X-Original-Trace: 29 Oct 2008 09:18:50 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88073
Article PK: 417326

Try GetFullState/SetFullState before closing instead of
GetChanges/SetChanges

<Sharon> wrote in message news:49089696.4dfa.1681692777@sybase.com...
> Yes, I did
> Works ok for adds & changes, but not deletes.
> I pass this datawindow back & forth from the calling &
> response.
>>
>
> Did you apply the changes from the response window DW to
>> the calling window DW before closing the response window?
>>
>> <Sharon> wrote in message
>> > news:49088295.49e2.1681692777@sybase.com... Jerry,
>> > I used this approach all seemed to work well.
>> > However if I delete a row from the data window in the
>> > response window, it shows a rowcount of say 2 rows,
>> > which is correct.
>> > After returning to the calling window the rowcount says
>> > 3 rows & the deleted row is still there.
>> > Any ideas?
>> >
>> >
>> >> That's because objects are always passed by reference,
>> and >> after the CloseWithParm, back in the calling
>> window, the >> response window is already destroyed!
>> >> What I have done in a similar situation is define an
>> >> instance variable in the response window DataWindow
>> >> i_pass_dw In the open event of the response window
>> >> Blob bl_pass
>> >> i_pass_dw = message.powerobjectparm
>> >> // a local variable would vanish when the script
>> completes >> , // and the Message object is subject to
>> reuse >> bl_pass = i_pass_dw.GetFullState()
>> >> dw_task.SetFullState (bl_pass)
>> >>
>> >> To close the response window, if the user selected
>> cancel, >> just Close(this) If the user selected Save/OK
>> >> Blob bl_changes
>> >> dw_task.GetChanges (bl_changes)
>> >> i_pass_dw.SetChanges (bl_changes)
>> >> // applies changes to the passed reference DW - it
>> remains >> in the main window's unit of work
>> >> Close(this)
>> >> // or CloseWithReturn if you have other data to send
>> back >>
>> >>
>> >> <sharon> wrote in message
>> >> news:49074c15.1f6e.1681692777@sybase.com... >> Hello,
>> yes >> > I am sure the window is of type response. after
>> the >> > response window closes, the pass back to the main
>> window >> does not work. I get the null object referenct.
>> > >> > in calling window
>> >> > openwithparm(w_response, dw_task)
>> >> >
>> >> > in response
>> >> > dw_task = message.powerobjectparm
>> >> >
>> >> > the above works fine, the reverse with the
>> closewithparm >> > does not.
>> >> >
>> >> >
>> >> > Hi Sharon;
>> >> >>
>> >> >> Yes ... absolutely, you can pass any object
>> type >> as a >> reference that way.
>> >> >>
>> >> >> Are you sure that the window you are opening is
>> >> >> actually saved as a "Response" dialog? If not, that
>> >> would >> entirely break the use of the
>> Open/CloseWithParm >> scenario >> and the
>> "PowerObjectParm" could easily be >> reused/reset - >>
>> thus ending in a Null Object error. >> >>
>> >> >> Is the Message.PowerObjectParm assignment being
>> >> done >> right after the OpenWithParm ( ) method call?
>> >> >>
>> >> >> --
>> >> >> Regards ... Chris
>> >> >> ISUG - NA RUG Director
>> >> >> http://chrispollach.pbdjmagazine.com
>> >> >>
>> >> >>
>> >> >> <sharon> wrote in message
>> >> >> > news:49074468.1ea4.1681692777@sybase.com... using
>> pb >> >> > 11.5 Can I pass a datawindow using openwithparm
>> & >> >> closewithparm? >
>> >> >> > in response window
>> >> >> > closewithparm(this,dw_task)
>> >> >> >
>> >> >> > in calling window
>> >> >> > dw_task = message.powerobjectparm
>> >> >> > messagebox('rc',string(dw_task.rowcount()))
>> >> >> >
>> >> >> >
>> >> >> > I am getting a null object reference
>> >> >> > What am I doing wrong?
>> >> >>
>> >> >>
>> >>
>> >>
>>
>>


Chris Pollach Posted on 2008-10-28 18:12:29.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49074468.1ea4.1681692777@sybase.com>
Subject: Re: datawindow parameter passing
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4907560d$1@forums-1-dub>
Date: 28 Oct 2008 10:12:29 -0800
X-Trace: forums-1-dub 1225217549 10.22.241.152 (28 Oct 2008 10:12:29 -0800)
X-Original-Trace: 28 Oct 2008 10:12:29 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88059
Article PK: 417313

Ahhh ... I see - it should be:

CloseWithParm(THIS, dw_task.RowCount ( ))

.....

Messagebox('rc',string( Message.DoubleParm )

<sharon> wrote in message news:49074468.1ea4.1681692777@sybase.com...
> using pb 11.5
> Can I pass a datawindow using openwithparm & closewithparm?
>
> in response window
> closewithparm(this,dw_task)
>
> in calling window
> dw_task = message.powerobjectparm
> messagebox('rc',string(dw_task.rowcount()))
>
>
> I am getting a null object reference
> What am I doing wrong?