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.

DropDown DataWindow InsertRow

8 posts in DataWindow Last posting was on 2008-04-17 13:11:08.0Z
Kemal Posted on 2008-04-16 20:55:29.0Z
Sender: 2052.4806642b.1804289383@sybase.com
From: Kemal
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: DropDown DataWindow InsertRow
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <480667c1.2097.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 16 Apr 2008 13:55:29 -0700
X-Trace: forums-1-dub 1208379329 10.22.241.41 (16 Apr 2008 13:55:29 -0700)
X-Original-Trace: 16 Apr 2008 13:55:29 -0700, 10.22.241.41
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86649
Article PK: 415908

Hi everyone,
I use pb 11.1 Enterprise Edition
I have a dropdown datawindow. I use this datawindow in
another datawindow as a dropdown.
When this datawindow retrieve its items i need to insert a
new row, "Please Select". And it must be first row i can not
do this.
Below is that i tried but i couldn't could you tell me the
right way?
First i get the child datawindow and insert a new row and
set this row's text "Please Select". Everything is fine but
i can not show this as a first row. (I tried scrolltorow
function)


Jason 'Bug' Fenter [TeamSybase] Posted on 2008-04-16 21:08:31.0Z
From: "Jason 'Bug' Fenter [TeamSybase]" <jason.fenter@teamsybase.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: DropDown DataWindow InsertRow
References: <480667c1.2097.1681692777@sybase.com>
In-Reply-To: <480667c1.2097.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48066acf$1@forums-1-dub>
Date: 16 Apr 2008 14:08:31 -0700
X-Trace: forums-1-dub 1208380111 10.22.241.152 (16 Apr 2008 14:08:31 -0700)
X-Original-Trace: 16 Apr 2008 14:08:31 -0700, vip152.sybase.com
Lines: 28
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86650
Article PK: 415909

You've almost got it.
1. Use GetChild() to get a reference to the child datawindow.
2. Do a Retrieve() on the child.
3. Do an InsertRow(1) /* NOT 0! Insert 1! */.
4. Do a SetItem on row 1 for your "Please Select" display value *and
some generic data value*
5. Once that's done, do a SetItem on the PARENT datawindow to set that
column to the generic data value you used in the previous step.


That last one was probably the only thing you were missing.

Kemal wrote:
> Hi everyone,
> I use pb 11.1 Enterprise Edition
> I have a dropdown datawindow. I use this datawindow in
> another datawindow as a dropdown.
> When this datawindow retrieve its items i need to insert a
> new row, "Please Select". And it must be first row i can not
> do this.
> Below is that i tried but i couldn't could you tell me the
> right way?
> First i get the child datawindow and insert a new row and
> set this row's text "Please Select". Everything is fine but
> i can not show this as a first row. (I tried scrolltorow
> function)


Kemal Posted on 2008-04-17 07:15:52.0Z
Sender: 1481.4805e999.1804289383@sybase.com
From: Kemal
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: DropDown DataWindow InsertRow
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4806f928.29fe.1681692777@sybase.com>
References: <48066acf$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Apr 2008 00:15:52 -0700
X-Trace: forums-1-dub 1208416552 10.22.241.41 (17 Apr 2008 00:15:52 -0700)
X-Original-Trace: 17 Apr 2008 00:15:52 -0700, 10.22.241.41
Lines: 35
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86651
Article PK: 415910

Yes i ve inserted the new row and its generic value to my
child datawindow as a first row. But still when parent
datawindow opens i see second row. So i need to set mine new
row as a first appears? How can i do this? (I tried
scrollToRow, selectRow functions but it doesnt work)

> You've almost got it.
> 1. Use GetChild() to get a reference to the child
> datawindow. 2. Do a Retrieve() on the child.
> 3. Do an InsertRow(1) /* NOT 0! Insert 1! */.
> 4. Do a SetItem on row 1 for your "Please Select" display
> value *and some generic data value*
> 5. Once that's done, do a SetItem on the PARENT datawindow
> to set that column to the generic data value you used in
> the previous step.
>
>
> That last one was probably the only thing you were
> missing.
>
>
>
> Kemal wrote:
> > Hi everyone,
> > I use pb 11.1 Enterprise Edition
> > I have a dropdown datawindow. I use this datawindow in
> > another datawindow as a dropdown.
> > When this datawindow retrieve its items i need to insert
> > a new row, "Please Select". And it must be first row i
> > can not do this.
> > Below is that i tried but i couldn't could you tell me
> > the right way?
> > First i get the child datawindow and insert a new row
> > and set this row's text "Please Select". Everything is
> > fine but i can not show this as a first row. (I tried
> > scrolltorow function)


Chris Werner Posted on 2008-04-17 07:51:49.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48066acf$1@forums-1-dub> <4806f928.29fe.1681692777@sybase.com>
Subject: Re: DropDown DataWindow InsertRow
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48070195$1@forums-1-dub>
Date: 17 Apr 2008 00:51:49 -0700
X-Trace: forums-1-dub 1208418709 10.22.241.152 (17 Apr 2008 00:51:49 -0700)
X-Original-Trace: 17 Apr 2008 00:51:49 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86652
Article PK: 415911

Hi Kemal,

you have to use setItem in the parent dataWindow
to show "Please Select". I assume you insert something
like Data Value = "-" and Display Value = "Please Select"
into the child dataWindow:

long ll_childRow
dataWindowChild ldwc_dddw
// ... get the dddw into ldwc_dddw using getChild ... //
ll_childRow = ldwc_dddw.insertRow(1)
ldwc_dddw.setItem(ll_childRow, "dataCol", "-")
ldwc_dddw.setItem(ll_childRow, "dispCol", "Please Select")

After that is done you call

dw_1.setItem(ll_row, ls_colName, "-")

where ll_row is the row number and ls_colName is the column
name which holds the DDDW in the PARENT dataWindow.

This "-" is the generic data value and my be replaced by some
other value.

HTH

Chris Werner
f+s software gmbh

<Kemal> schrieb im Newsbeitrag news:4806f928.29fe.1681692777@sybase.com...

> Yes i ve inserted the new row and its generic value to my
> child datawindow as a first row. But still when parent
> datawindow opens i see second row. So i need to set mine new
> row as a first appears? How can i do this? (I tried
> scrollToRow, selectRow functions but it doesnt work)
>> You've almost got it.
>> 1. Use GetChild() to get a reference to the child
>> datawindow. 2. Do a Retrieve() on the child.
>> 3. Do an InsertRow(1) /* NOT 0! Insert 1! */.
>> 4. Do a SetItem on row 1 for your "Please Select" display
>> value *and some generic data value*
>> 5. Once that's done, do a SetItem on the PARENT datawindow
>> to set that column to the generic data value you used in
>> the previous step.
>>
>>
>> That last one was probably the only thing you were
>> missing.
>>
>>
>>
>> Kemal wrote:
>> > Hi everyone,
>> > I use pb 11.1 Enterprise Edition
>> > I have a dropdown datawindow. I use this datawindow in
>> > another datawindow as a dropdown.
>> > When this datawindow retrieve its items i need to insert
>> > a new row, "Please Select". And it must be first row i
>> > can not do this.
>> > Below is that i tried but i couldn't could you tell me
>> > the right way?
>> > First i get the child datawindow and insert a new row
>> > and set this row's text "Please Select". Everything is
>> > fine but i can not show this as a first row. (I tried
>> > scrolltorow function)


Kemal Posted on 2008-04-17 08:49:43.0Z
Sender: 1481.4805e999.1804289383@sybase.com
From: Kemal
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: DropDown DataWindow InsertRow
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48070f27.2b51.1681692777@sybase.com>
References: <48070195$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Apr 2008 01:49:43 -0700
X-Trace: forums-1-dub 1208422183 10.22.241.41 (17 Apr 2008 01:49:43 -0700)
X-Original-Trace: 17 Apr 2008 01:49:43 -0700, 10.22.241.41
Lines: 93
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86653
Article PK: 415912

Still when parent datawindow opens it doesnt show my new
row. (Ok i inserted it as a first row but i just want to
show it when datawindow control appears)
Here is my full code.

///////////////////START////////////////////
dw_compliant_type.SetTransObject(SQLCA)
dw_compliant_type.retrieve()

DataWindowChild state_child
integer rtncode
rtncode = dw_compliant_type.GetChild('description',
state_child)
IF rtncode = -1 THEN
MessageBox("Error", "Not a DataWindowChild")
return
END IF
state_child.InsertRow(1)
state_child.SetItem(1, "description", "Please Select")
state_child.SetItem(1, "id", -1)
dw_compliant_type.SetItem(1,"id",-1)
////////////////END/////////////////////

> Hi Kemal,
>
> you have to use setItem in the parent dataWindow
> to show "Please Select". I assume you insert something
> like Data Value = "-" and Display Value = "Please Select"
> into the child dataWindow:
>
> long ll_childRow
> dataWindowChild ldwc_dddw
> // ... get the dddw into ldwc_dddw using getChild ... //
> ll_childRow = ldwc_dddw.insertRow(1)
> ldwc_dddw.setItem(ll_childRow, "dataCol", "-")
> ldwc_dddw.setItem(ll_childRow, "dispCol", "Please
> Select")
>
> After that is done you call
>
> dw_1.setItem(ll_row, ls_colName, "-")
>
> where ll_row is the row number and ls_colName is the
> column name which holds the DDDW in the PARENT dataWindow.
>
> This "-" is the generic data value and my be replaced by
> some other value.
>
> HTH
>
> Chris Werner
> f+s software gmbh
>
> <Kemal> schrieb im Newsbeitrag
> > news:4806f928.29fe.1681692777@sybase.com... Yes i ve
> > inserted the new row and its generic value to my child
> > datawindow as a first row. But still when parent
> datawindow opens i see second row. So i need to set mine
> > new row as a first appears? How can i do this? (I tried
> > scrollToRow, selectRow functions but it doesnt work)
> >> You've almost got it.
> >> 1. Use GetChild() to get a reference to the child
> >> datawindow. 2. Do a Retrieve() on the child.
> >> 3. Do an InsertRow(1) /* NOT 0! Insert 1! */.
> >> 4. Do a SetItem on row 1 for your "Please Select"
> display >> value *and some generic data value*
> >> 5. Once that's done, do a SetItem on the PARENT
> datawindow >> to set that column to the generic data
> value you used in >> the previous step.
> >>
> >>
> >> That last one was probably the only thing you were
> >> missing.
> >>
> >>
> >>
> >> Kemal wrote:
> >> > Hi everyone,
> >> > I use pb 11.1 Enterprise Edition
> >> > I have a dropdown datawindow. I use this datawindow
> in >> > another datawindow as a dropdown.
> >> > When this datawindow retrieve its items i need to
> insert >> > a new row, "Please Select". And it must be
> first row i >> > can not do this.
> >> > Below is that i tried but i couldn't could you tell
> me >> > the right way?
> >> > First i get the child datawindow and insert a new row
> >> > and set this row's text "Please Select". Everything
> is >> > fine but i can not show this as a first row. (I
> tried >> > scrolltorow function)
>
>


Chris Werner Posted on 2008-04-17 10:12:11.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48070195$1@forums-1-dub> <48070f27.2b51.1681692777@sybase.com>
Subject: Re: DropDown DataWindow InsertRow
Lines: 116
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4807227b$1@forums-1-dub>
Date: 17 Apr 2008 03:12:11 -0700
X-Trace: forums-1-dub 1208427131 10.22.241.152 (17 Apr 2008 03:12:11 -0700)
X-Original-Trace: 17 Apr 2008 03:12:11 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86655
Article PK: 415913

Hi Kemal,

something's wrong here:

rtncode = dw_compliant_type.GetChild('description', state_child)
...
dw_compliant_type.SetItem(1,"id",-1)

The last line must be:

dw_compliant_type.SetItem(1,"description",-1)

HTH

Chris Werner
f+s software gmbh




<Kemal> schrieb im Newsbeitrag news:48070f27.2b51.1681692777@sybase.com...

> Still when parent datawindow opens it doesnt show my new
> row. (Ok i inserted it as a first row but i just want to
> show it when datawindow control appears)
> Here is my full code.
>
> ///////////////////START////////////////////
> dw_compliant_type.SetTransObject(SQLCA)
> dw_compliant_type.retrieve()
>
> DataWindowChild state_child
> integer rtncode
> rtncode = dw_compliant_type.GetChild('description',
> state_child)
> IF rtncode = -1 THEN
> MessageBox("Error", "Not a DataWindowChild")
> return
> END IF
> state_child.InsertRow(1)
> state_child.SetItem(1, "description", "Please Select")
> state_child.SetItem(1, "id", -1)
> dw_compliant_type.SetItem(1,"id",-1)
> ////////////////END/////////////////////
>
>
>> Hi Kemal,
>>
>> you have to use setItem in the parent dataWindow
>> to show "Please Select". I assume you insert something
>> like Data Value = "-" and Display Value = "Please Select"
>> into the child dataWindow:
>>
>> long ll_childRow
>> dataWindowChild ldwc_dddw
>> // ... get the dddw into ldwc_dddw using getChild ... //
>> ll_childRow = ldwc_dddw.insertRow(1)
>> ldwc_dddw.setItem(ll_childRow, "dataCol", "-")
>> ldwc_dddw.setItem(ll_childRow, "dispCol", "Please
>> Select")
>>
>> After that is done you call
>>
>> dw_1.setItem(ll_row, ls_colName, "-")
>>
>> where ll_row is the row number and ls_colName is the
>> column name which holds the DDDW in the PARENT dataWindow.
>>
>> This "-" is the generic data value and my be replaced by
>> some other value.
>>
>> HTH
>>
>> Chris Werner
>> f+s software gmbh
>>
>> <Kemal> schrieb im Newsbeitrag
>> > news:4806f928.29fe.1681692777@sybase.com... Yes i ve
>> > inserted the new row and its generic value to my child
>> > datawindow as a first row. But still when parent
>> datawindow opens i see second row. So i need to set mine
>> > new row as a first appears? How can i do this? (I tried
>> > scrollToRow, selectRow functions but it doesnt work)
>> >> You've almost got it.
>> >> 1. Use GetChild() to get a reference to the child
>> >> datawindow. 2. Do a Retrieve() on the child.
>> >> 3. Do an InsertRow(1) /* NOT 0! Insert 1! */.
>> >> 4. Do a SetItem on row 1 for your "Please Select"
>> display >> value *and some generic data value*
>> >> 5. Once that's done, do a SetItem on the PARENT
>> datawindow >> to set that column to the generic data
>> value you used in >> the previous step.
>> >>
>> >>
>> >> That last one was probably the only thing you were
>> >> missing.
>> >>
>> >>
>> >>
>> >> Kemal wrote:
>> >> > Hi everyone,
>> >> > I use pb 11.1 Enterprise Edition
>> >> > I have a dropdown datawindow. I use this datawindow
>> in >> > another datawindow as a dropdown.
>> >> > When this datawindow retrieve its items i need to
>> insert >> > a new row, "Please Select". And it must be
>> first row i >> > can not do this.
>> >> > Below is that i tried but i couldn't could you tell
>> me >> > the right way?
>> >> > First i get the child datawindow and insert a new row
>> >> > and set this row's text "Please Select". Everything
>> is >> > fine but i can not show this as a first row. (I
>> tried >> > scrolltorow function)
>>
>>


Kemal Posted on 2008-04-17 12:42:58.0Z
Sender: 1481.4805e999.1804289383@sybase.com
From: Kemal
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: DropDown DataWindow InsertRow
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <480745d2.30d3.1681692777@sybase.com>
References: <4807227b$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Apr 2008 05:42:58 -0700
X-Trace: forums-1-dub 1208436178 10.22.241.41 (17 Apr 2008 05:42:58 -0700)
X-Original-Trace: 17 Apr 2008 05:42:58 -0700, 10.22.241.41
Lines: 121
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86656
Article PK: 415916

Now i changed all "id" to "description". But still i have
same problem. I think i cant tell my problem properly. I
insert a new row and it is first row everything is fine. But
it still shows me second row when the window opened.

> Hi Kemal,
>
> something's wrong here:
>
> rtncode = dw_compliant_type.GetChild('description',
> state_child)
> ...
> dw_compliant_type.SetItem(1,"id",-1)
>
> The last line must be:
>
> dw_compliant_type.SetItem(1,"description",-1)
>
> HTH
>
> Chris Werner
> f+s software gmbh
>
>
>
>
> <Kemal> schrieb im Newsbeitrag
> > news:48070f27.2b51.1681692777@sybase.com... Still when
> > parent datawindow opens it doesnt show my new row. (Ok i
> > inserted it as a first row but i just want to show it
> > when datawindow control appears) Here is my full code.
> >
> > ///////////////////START////////////////////
> > dw_compliant_type.SetTransObject(SQLCA)
> > dw_compliant_type.retrieve()
> >
> > DataWindowChild state_child
> > integer rtncode
> > rtncode = dw_compliant_type.GetChild('description',
> > state_child)
> > IF rtncode = -1 THEN
> > MessageBox("Error", "Not a DataWindowChild")
> > return
> > END IF
> > state_child.InsertRow(1)
> > state_child.SetItem(1, "description", "Please Select")
> > state_child.SetItem(1, "id", -1)
> > dw_compliant_type.SetItem(1,"id",-1)
> > ////////////////END/////////////////////
> >
> >
> >> Hi Kemal,
> >>
> >> you have to use setItem in the parent dataWindow
> >> to show "Please Select". I assume you insert something
> >> like Data Value = "-" and Display Value = "Please
> Select" >> into the child dataWindow:
> >>
> >> long ll_childRow
> >> dataWindowChild ldwc_dddw
> >> // ... get the dddw into ldwc_dddw using getChild ...
> // >> ll_childRow = ldwc_dddw.insertRow(1)
> >> ldwc_dddw.setItem(ll_childRow, "dataCol", "-")
> >> ldwc_dddw.setItem(ll_childRow, "dispCol", "Please
> >> Select")
> >>
> >> After that is done you call
> >>
> >> dw_1.setItem(ll_row, ls_colName, "-")
> >>
> >> where ll_row is the row number and ls_colName is the
> >> column name which holds the DDDW in the PARENT
> dataWindow. >>
> >> This "-" is the generic data value and my be replaced
> by >> some other value.
> >>
> >> HTH
> >>
> >> Chris Werner
> >> f+s software gmbh
> >>
> >> <Kemal> schrieb im Newsbeitrag
> >> > news:4806f928.29fe.1681692777@sybase.com... Yes i ve
> >> > inserted the new row and its generic value to my
> child >> > datawindow as a first row. But still when
> parent >> datawindow opens i see second row. So i need to
> set mine >> > new row as a first appears? How can i do
> this? (I tried >> > scrollToRow, selectRow functions but
> it doesnt work) >> >> You've almost got it.
> >> >> 1. Use GetChild() to get a reference to the child
> >> >> datawindow. 2. Do a Retrieve() on the child.
> >> >> 3. Do an InsertRow(1) /* NOT 0! Insert 1! */.
> >> >> 4. Do a SetItem on row 1 for your "Please Select"
> >> display >> value *and some generic data value*
> >> >> 5. Once that's done, do a SetItem on the PARENT
> >> datawindow >> to set that column to the generic data
> >> value you used in >> the previous step.
> >> >>
> >> >>
> >> >> That last one was probably the only thing you were
> >> >> missing.
> >> >>
> >> >>
> >> >>
> >> >> Kemal wrote:
> >> >> > Hi everyone,
> >> >> > I use pb 11.1 Enterprise Edition
> >> >> > I have a dropdown datawindow. I use this
> datawindow >> in >> > another datawindow as a dropdown.
> >> >> > When this datawindow retrieve its items i need to
> >> insert >> > a new row, "Please Select". And it must be
> >> first row i >> > can not do this.
> >> >> > Below is that i tried but i couldn't could you
> tell >> me >> > the right way?
> >> >> > First i get the child datawindow and insert a new
> row >> >> > and set this row's text "Please Select".
> Everything >> is >> > fine but i can not show this as a
> first row. (I >> tried >> > scrolltorow function)
> >>
> >>
>
>


Chris Werner Posted on 2008-04-17 13:11:08.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4807227b$1@forums-1-dub> <480745d2.30d3.1681692777@sybase.com>
Subject: Re: DropDown DataWindow InsertRow
Lines: 150
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48074c6c@forums-1-dub>
Date: 17 Apr 2008 06:11:08 -0700
X-Trace: forums-1-dub 1208437868 10.22.241.152 (17 Apr 2008 06:11:08 -0700)
X-Original-Trace: 17 Apr 2008 06:11:08 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86658
Article PK: 415917

Hi Kemal,

you've decribed the problem properly. But what I've
suggested was changing "id" into "description" in this
line of code only:

dw_compliant_type.SetItem(1,"id",-1)

Given that the DDDW column in the *parent DW* is named
"description" the question rises what its datatype is and what
do you expect to be stored there? Is it numeric and stores a
description id (a number) or is it char and stores the description
itself? If it is char the code line above changes to

dw_compliant_type.SetItem(1,"decription", "Please select")

In this case it should be unnecessary to insert a row into
the child datawindow.

Let us know how it goes

Chris Werner
f+s software gmbh



<Kemal> schrieb im Newsbeitrag news:480745d2.30d3.1681692777@sybase.com...

> Now i changed all "id" to "description". But still i have
> same problem. I think i cant tell my problem properly. I
> insert a new row and it is first row everything is fine. But
> it still shows me second row when the window opened.
>> Hi Kemal,
>>
>> something's wrong here:
>>
>> rtncode = dw_compliant_type.GetChild('description',
>> state_child)
>> ...
>> dw_compliant_type.SetItem(1,"id",-1)
>>
>> The last line must be:
>>
>> dw_compliant_type.SetItem(1,"description",-1)
>>
>> HTH
>>
>> Chris Werner
>> f+s software gmbh
>>
>>
>>
>>
>> <Kemal> schrieb im Newsbeitrag
>> > news:48070f27.2b51.1681692777@sybase.com... Still when
>> > parent datawindow opens it doesnt show my new row. (Ok i
>> > inserted it as a first row but i just want to show it
>> > when datawindow control appears) Here is my full code.
>> >
>> > ///////////////////START////////////////////
>> > dw_compliant_type.SetTransObject(SQLCA)
>> > dw_compliant_type.retrieve()
>> >
>> > DataWindowChild state_child
>> > integer rtncode
>> > rtncode = dw_compliant_type.GetChild('description',
>> > state_child)
>> > IF rtncode = -1 THEN
>> > MessageBox("Error", "Not a DataWindowChild")
>> > return
>> > END IF
>> > state_child.InsertRow(1)
>> > state_child.SetItem(1, "description", "Please Select")
>> > state_child.SetItem(1, "id", -1)
>> > dw_compliant_type.SetItem(1,"id",-1)
>> > ////////////////END/////////////////////
>> >
>> >
>> >> Hi Kemal,
>> >>
>> >> you have to use setItem in the parent dataWindow
>> >> to show "Please Select". I assume you insert something
>> >> like Data Value = "-" and Display Value = "Please
>> Select" >> into the child dataWindow:
>> >>
>> >> long ll_childRow
>> >> dataWindowChild ldwc_dddw
>> >> // ... get the dddw into ldwc_dddw using getChild ...
>> // >> ll_childRow = ldwc_dddw.insertRow(1)
>> >> ldwc_dddw.setItem(ll_childRow, "dataCol", "-")
>> >> ldwc_dddw.setItem(ll_childRow, "dispCol", "Please
>> >> Select")
>> >>
>> >> After that is done you call
>> >>
>> >> dw_1.setItem(ll_row, ls_colName, "-")
>> >>
>> >> where ll_row is the row number and ls_colName is the
>> >> column name which holds the DDDW in the PARENT
>> dataWindow. >>
>> >> This "-" is the generic data value and my be replaced
>> by >> some other value.
>> >>
>> >> HTH
>> >>
>> >> Chris Werner
>> >> f+s software gmbh
>> >>
>> >> <Kemal> schrieb im Newsbeitrag
>> >> > news:4806f928.29fe.1681692777@sybase.com... Yes i ve
>> >> > inserted the new row and its generic value to my
>> child >> > datawindow as a first row. But still when
>> parent >> datawindow opens i see second row. So i need to
>> set mine >> > new row as a first appears? How can i do
>> this? (I tried >> > scrollToRow, selectRow functions but
>> it doesnt work) >> >> You've almost got it.
>> >> >> 1. Use GetChild() to get a reference to the child
>> >> >> datawindow. 2. Do a Retrieve() on the child.
>> >> >> 3. Do an InsertRow(1) /* NOT 0! Insert 1! */.
>> >> >> 4. Do a SetItem on row 1 for your "Please Select"
>> >> display >> value *and some generic data value*
>> >> >> 5. Once that's done, do a SetItem on the PARENT
>> >> datawindow >> to set that column to the generic data
>> >> value you used in >> the previous step.
>> >> >>
>> >> >>
>> >> >> That last one was probably the only thing you were
>> >> >> missing.
>> >> >>
>> >> >>
>> >> >>
>> >> >> Kemal wrote:
>> >> >> > Hi everyone,
>> >> >> > I use pb 11.1 Enterprise Edition
>> >> >> > I have a dropdown datawindow. I use this
>> datawindow >> in >> > another datawindow as a dropdown.
>> >> >> > When this datawindow retrieve its items i need to
>> >> insert >> > a new row, "Please Select". And it must be
>> >> first row i >> > can not do this.
>> >> >> > Below is that i tried but i couldn't could you
>> tell >> me >> > the right way?
>> >> >> > First i get the child datawindow and insert a new
>> row >> >> > and set this row's text "Please Select".
>> Everything >> is >> > fine but i can not show this as a
>> first row. (I >> tried >> > scrolltorow function)
>> >>
>> >>
>>
>>