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.

dynamic sort/group--is it possible?

5 posts in Objects Last posting was on 2007-05-09 18:35:34.0Z
marian-saic Posted on 2007-04-02 16:19:44.0Z
Sender: 43af.46111c2e.1804289383@sybase.com
From: Marian-SAIC
Newsgroups: sybase.public.powerbuilder.objects
Subject: dynamic sort/group--is it possible?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <46111f10.43fd.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 2 Apr 2007 08:19:44 -0800
X-Trace: forums-1-dub 1175527184 10.22.241.41 (2 Apr 2007 08:19:44 -0800)
X-Original-Trace: 2 Apr 2007 08:19:44 -0800, 10.22.241.41
Lines: 24
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9311
Article PK: 736472

I have a question/problem about creating a group on a
datawindow. Is the sort/group process activated only after
a save?

The datawindow on one tab is built based on data entered on
another tab. When the customer reviewed the tab contents,
he pointed out that the data was not grouped as requested.
If he does a SAVE, I refresh the screen with the following
code:

li_return = luo_equipment.setRedraw(false)
li_return = luo_equipment.SORT()
li_return = luo_equipment.GROUPCALC()
luo_equipment.setRedraw(true)

and the data is grouped correctly. The group also works if
the user is merely retrieving the data. But the data is not
constantly regrouped and refreshed as he dynamically adds
data.

I tried adding the code above immediately after the setItem
to no avail. I tried adding the code to the getFocus event
of the tab to no avail. What am I missing here? Can I not
sort (and group) data dynamically on the datawindow?


Chris Werner Posted on 2007-04-02 18:06:20.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.objects
References: <46111f10.43fd.1681692777@sybase.com>
Subject: Re: dynamic sort/group--is it possible?
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: 62.8.156.42
X-Original-NNTP-Posting-Host: 62.8.156.42
Message-ID: <4611380c@forums-1-dub>
Date: 2 Apr 2007 10:06:20 -0800
X-Trace: forums-1-dub 1175533580 62.8.156.42 (2 Apr 2007 10:06:20 -0800)
X-Original-Trace: 2 Apr 2007 10:06:20 -0800, 62.8.156.42
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9312
Article PK: 736470

Hi Marian,

if luo_equipment is a dataWindow control your code
should resort and regroup the datawindow. Given your
observation that the data is grouped correctly after a save
one might guess that the save routine contains an
acceptText() call on the source datawindow (the one
where the user edits data). How are the data tranfered
between the two tabs? You've mentioned setItem() but
when and how are the values used in setItem obtained?
I'd try either to code an acceptText() call on the source
datawindow prior getting the data out of it or - in case
you transfer the data in the itemChanged event - to check
wether there are some getItemXXX() calls for the item
under change because that would deliver the old value
instead of the new one.

HTH

Chris Werner
f+s software gmbh


<Marian-SAIC> schrieb im Newsbeitrag
news:46111f10.43fd.1681692777@sybase.com...

>I have a question/problem about creating a group on a
> datawindow. Is the sort/group process activated only after
> a save?
>
> The datawindow on one tab is built based on data entered on
> another tab. When the customer reviewed the tab contents,
> he pointed out that the data was not grouped as requested.
> If he does a SAVE, I refresh the screen with the following
> code:
>
> li_return = luo_equipment.setRedraw(false)
> li_return = luo_equipment.SORT()
> li_return = luo_equipment.GROUPCALC()
> luo_equipment.setRedraw(true)
>
> and the data is grouped correctly. The group also works if
> the user is merely retrieving the data. But the data is not
> constantly regrouped and refreshed as he dynamically adds
> data.
>
> I tried adding the code above immediately after the setItem
> to no avail. I tried adding the code to the getFocus event
> of the tab to no avail. What am I missing here? Can I not
> sort (and group) data dynamically on the datawindow?


marian-saic Posted on 2007-04-02 20:49:22.0Z
Sender: 43af.46111c2e.1804289383@sybase.com
From: marian-saic
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: dynamic sort/group--is it possible?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <46115e42.4916.1681692777@sybase.com>
References: <4611380c@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 2 Apr 2007 12:49:22 -0800
X-Trace: forums-1-dub 1175543362 10.22.241.41 (2 Apr 2007 12:49:22 -0800)
X-Original-Trace: 2 Apr 2007 12:49:22 -0800, 10.22.241.41
Lines: 71
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9313
Article PK: 736471

Yes, luo_equipment is the datawindow control.
The user picks from a related equipment list on one tab.
The user object on that tab populates an array of the
equipment keys. It then loops through the various arrays
and, via a function extracts the details about the
equipment. It uses setitem to assign values on the user
object/datawindow associated with the equipment tab. So
when the user selects the equipment tab, the equipment
associated with his prior selection has already populated
that window.

In stepping through the code, I saw that an AcceptText was
triggered by the sort() command. I thought that was
sufficient. I will try to explicitly code it.

-Marian

> Hi Marian,
>
> if luo_equipment is a dataWindow control your code
> should resort and regroup the datawindow. Given your
> observation that the data is grouped correctly after a
> save one might guess that the save routine contains an
> acceptText() call on the source datawindow (the one
> where the user edits data). How are the data tranfered
> between the two tabs? You've mentioned setItem() but
> when and how are the values used in setItem obtained?
> I'd try either to code an acceptText() call on the source
> datawindow prior getting the data out of it or - in case
> you transfer the data in the itemChanged event - to check
> wether there are some getItemXXX() calls for the item
> under change because that would deliver the old value
> instead of the new one.
>
> HTH
>
> Chris Werner
> f+s software gmbh
>
>
> <Marian-SAIC> schrieb im Newsbeitrag
> news:46111f10.43fd.1681692777@sybase.com...
> >I have a question/problem about creating a group on a
> > datawindow. Is the sort/group process activated only
> > after a save?
> >
> > The datawindow on one tab is built based on data entered
> > on another tab. When the customer reviewed the tab
> > contents, he pointed out that the data was not grouped
> > as requested. If he does a SAVE, I refresh the screen
> > with the following code:
> >
> > li_return = luo_equipment.setRedraw(false)
> > li_return = luo_equipment.SORT()
> > li_return = luo_equipment.GROUPCALC()
> > luo_equipment.setRedraw(true)
> >
> > and the data is grouped correctly. The group also works
> > if the user is merely retrieving the data. But the data
> > is not constantly regrouped and refreshed as he
> > dynamically adds data.
> >
> > I tried adding the code above immediately after the
> > setItem to no avail. I tried adding the code to the
> > getFocus event of the tab to no avail. What am I
> > missing here? Can I not sort (and group) data
> dynamically on the datawindow?
>
>


Marian Posted on 2007-04-02 22:53:04.0Z
Sender: 43af.46111c2e.1804289383@sybase.com
From: Marian
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: dynamic sort/group--is it possible?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <46117b40.4b6e.1681692777@sybase.com>
References: <4611380c@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 2 Apr 2007 14:53:04 -0800
X-Trace: forums-1-dub 1175550784 10.22.241.41 (2 Apr 2007 14:53:04 -0800)
X-Original-Trace: 2 Apr 2007 14:53:04 -0800, 10.22.241.41
Lines: 65
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9314
Article PK: 736475

Found the problem, due to your suggestion and a co-worker's
question.

The sql code for the datawindow was assigning the
(invisible) group/by field based on table contents.
The SetItem statements that established the datawindow were
not assigning a value to the group/by field.

Once, I added a setitem for the invisible group/by field, it
worked. Thanks.

> Hi Marian,
>
> if luo_equipment is a dataWindow control your code
> should resort and regroup the datawindow. Given your
> observation that the data is grouped correctly after a
> save one might guess that the save routine contains an
> acceptText() call on the source datawindow (the one
> where the user edits data). How are the data tranfered
> between the two tabs? You've mentioned setItem() but
> when and how are the values used in setItem obtained?
> I'd try either to code an acceptText() call on the source
> datawindow prior getting the data out of it or - in case
> you transfer the data in the itemChanged event - to check
> wether there are some getItemXXX() calls for the item
> under change because that would deliver the old value
> instead of the new one.
>
> HTH
>
> Chris Werner
> f+s software gmbh
>
>
> <Marian-SAIC> schrieb im Newsbeitrag
> news:46111f10.43fd.1681692777@sybase.com...
> >I have a question/problem about creating a group on a
> > datawindow. Is the sort/group process activated only
> > after a save?
> >
> > The datawindow on one tab is built based on data entered
> > on another tab. When the customer reviewed the tab
> > contents, he pointed out that the data was not grouped
> > as requested. If he does a SAVE, I refresh the screen
> > with the following code:
> >
> > li_return = luo_equipment.setRedraw(false)
> > li_return = luo_equipment.SORT()
> > li_return = luo_equipment.GROUPCALC()
> > luo_equipment.setRedraw(true)
> >
> > and the data is grouped correctly. The group also works
> > if the user is merely retrieving the data. But the data
> > is not constantly regrouped and refreshed as he
> > dynamically adds data.
> >
> > I tried adding the code above immediately after the
> > setItem to no avail. I tried adding the code to the
> > getFocus event of the tab to no avail. What am I
> > missing here? Can I not sort (and group) data
> dynamically on the datawindow?
>
>


Bobby D. Posted on 2007-05-09 18:35:34.0Z
Sender: f5a.46421330.1804289383@sybase.com
From: Bobby D.
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: dynamic sort/group--is it possible?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <46421476.f84.1681692777@sybase.com>
References: <46111f10.43fd.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 9 May 2007 11:35:34 -0700
X-Trace: forums-1-dub 1178735734 10.22.241.41 (9 May 2007 11:35:34 -0700)
X-Original-Trace: 9 May 2007 11:35:34 -0700, 10.22.241.41
Lines: 10
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9344
Article PK: 736507

Check under your group as well, check if there is no group
sort. When you go to the datawindow, and you select Edit
Group, look at the Sort Group tab and see if there is no
sorting already in place. If there is something, remove it
and try doing a SetSort() and specify the order you want ie
dw_1.SetSort("column1 A, column 2 A)
dw_1.Setredraw(FALSE)
dw_1.Sort()
dw_1.GroupCalc()
dw_1.SetRedraw(TRUE)