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.

autosize height

5 posts in DataWindow Last posting was on 2009-08-12 21:36:15.0Z
Derek Posted on 2009-08-12 00:21:26.0Z
From: Derek <drosin@mayo.edu>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: autosize height
Date: Tue, 11 Aug 2009 17:21:26 -0700 (PDT)
Organization: http://groups.google.com
Lines: 28
Message-ID: <63936638-cb41-4f06-9527-37cac398e3c8@c29g2000yqd.googlegroups.com>
NNTP-Posting-Host: 129.176.151.28
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1250036486 29954 127.0.0.1 (12 Aug 2009 00:21:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 12 Aug 2009 00:21:26 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: c29g2000yqd.googlegroups.com; posting-host=129.176.151.28; posting-account=afTtIAkAAAAej8n7XX5x9AnDOQ71NDn_
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!c29g2000yqd.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89759
Article PK: 418948

I have a simple data entry application that on one datawindow the user
enters four columns of information. The first three columns are of
type DDDW and the fourth is a free text field. Because of space
limitations and the type of data being entered I need to make the free
text column autosize so when they put in long notes the data wraps and
is displayed in its entirety.

That sounds simple enough in that I would think you just check the
autosize height on the column and detail band and verify that the auto
horz scroll property is not checked for the column and everything
should work. That is not the case. If I do this when I try to enter
data I'm limited to entering the amount of text that fits in the
column w/o scrolling. That is, it doesn't word wrap like you would
expect it too. PB documentation indicates that you shouldn't use
autosize height for data entry fields. So my questions are how do you
handle this type of problem?

I've tried setting the height myself using an expression. That works
fine (but requires the use of courier new for a font) for retrieving
data and displaying it properly but it doesn't work for entry for the
same reason as the autosize height solution doesn't work in that the
field doesn't wrap text as you type into it.

I'm using PB 10.5.1

Any ideas are appreciated.

TIA, Derek


"Paul Horan[Sybase]" <phoran_remove Posted on 2009-08-12 12:20:52.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <63936638-cb41-4f06-9527-37cac398e3c8@c29g2000yqd.googlegroups.com>
Subject: Re: autosize height
Lines: 39
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
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: <4a82b3a4$1@forums-3-dub.sybase.com>
Date: 12 Aug 2009 05:20:52 -0700
X-Trace: forums-3-dub.sybase.com 1250079652 10.22.241.152 (12 Aug 2009 05:20:52 -0700)
X-Original-Trace: 12 Aug 2009 05:20:52 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89760
Article PK: 418947

If it's a large data entry field, I don't use AutoSizeHeight - I set a
standard height and add a vertical scrollbar.

--
Paul Horan[Sybase]
http://blogs.sybase.com/phoran/

"Derek" <drosin@mayo.edu> wrote in message
news:63936638-cb41-4f06-9527-37cac398e3c8@c29g2000yqd.googlegroups.com...
>I have a simple data entry application that on one datawindow the user
> enters four columns of information. The first three columns are of
> type DDDW and the fourth is a free text field. Because of space
> limitations and the type of data being entered I need to make the free
> text column autosize so when they put in long notes the data wraps and
> is displayed in its entirety.
>
> That sounds simple enough in that I would think you just check the
> autosize height on the column and detail band and verify that the auto
> horz scroll property is not checked for the column and everything
> should work. That is not the case. If I do this when I try to enter
> data I'm limited to entering the amount of text that fits in the
> column w/o scrolling. That is, it doesn't word wrap like you would
> expect it too. PB documentation indicates that you shouldn't use
> autosize height for data entry fields. So my questions are how do you
> handle this type of problem?
>
> I've tried setting the height myself using an expression. That works
> fine (but requires the use of courier new for a font) for retrieving
> data and displaying it properly but it doesn't work for entry for the
> same reason as the autosize height solution doesn't work in that the
> field doesn't wrap text as you type into it.
>
> I'm using PB 10.5.1
>
> Any ideas are appreciated.
>
> TIA, Derek


Derek Posted on 2009-08-12 12:58:07.0Z
From: Derek <drosin@mayo.edu>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: autosize height
Date: Wed, 12 Aug 2009 05:58:07 -0700 (PDT)
Organization: http://groups.google.com
Lines: 11
Message-ID: <69f62d30-2115-4a10-a4ee-5173d7b9ff6e@v36g2000yqv.googlegroups.com>
References: <63936638-cb41-4f06-9527-37cac398e3c8@c29g2000yqd.googlegroups.com> <4a82b3a4$1@forums-3-dub.sybase.com>
NNTP-Posting-Host: 129.176.151.10
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1250081887 31977 127.0.0.1 (12 Aug 2009 12:58:07 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 12 Aug 2009 12:58:07 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: v36g2000yqv.googlegroups.com; posting-host=129.176.151.10; posting-account=afTtIAkAAAAej8n7XX5x9AnDOQ71NDn_
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!newsfeed.news2me.com!nx01.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!v36g2000yqv.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89761
Article PK: 418949

I'd like for them to be able to see the entire note without having to
scroll in the field.

The field holds up to 80 characters but only about 20 display so they
complain quite a bit when they can't see the information.

I'm going to try to see if I can dynamically turn on/off the vertical
scrollbar and set the height as they are typing. Not sure if that's
going to work but that's the next thing I'm going to try.

Thanks, Derek


"Paul Horan[Sybase]" <phoran_remove Posted on 2009-08-12 20:13:52.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <63936638-cb41-4f06-9527-37cac398e3c8@c29g2000yqd.googlegroups.com> <4a82b3a4$1@forums-3-dub.sybase.com> <69f62d30-2115-4a10-a4ee-5173d7b9ff6e@v36g2000yqv.googlegroups.com>
Subject: Re: autosize height
Lines: 30
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
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: <4a832280$2@forums-3-dub.sybase.com>
Date: 12 Aug 2009 13:13:52 -0700
X-Trace: forums-3-dub.sybase.com 1250108032 10.22.241.152 (12 Aug 2009 13:13:52 -0700)
X-Original-Trace: 12 Aug 2009 13:13:52 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89762
Article PK: 418951

There's nothing I can think of that will automatically make the column grow
in size as they type.

I can think of a couple of approaches.
- Write code in the EditChanged event to check the Len() of the data, then
Modify() the column height when you exceed a specified value. (Calculating
that value will be the hard part).
- Popup a MLE control over the top of the column, simulating the edit
control, and make that large enough to contain the entire text string. Then
do a SetItem() back into the column when that control loses focus.

--
Paul Horan[Sybase]
http://blogs.sybase.com/phoran/

"Derek" <drosin@mayo.edu> wrote in message
news:69f62d30-2115-4a10-a4ee-5173d7b9ff6e@v36g2000yqv.googlegroups.com...
> I'd like for them to be able to see the entire note without having to
> scroll in the field.
>
> The field holds up to 80 characters but only about 20 display so they
> complain quite a bit when they can't see the information.
>
> I'm going to try to see if I can dynamically turn on/off the vertical
> scrollbar and set the height as they are typing. Not sure if that's
> going to work but that's the next thing I'm going to try.
>
> Thanks, Derek


Derek Posted on 2009-08-12 21:36:15.0Z
From: Derek <drosin@mayo.edu>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: autosize height
Date: Wed, 12 Aug 2009 14:36:15 -0700 (PDT)
Organization: http://groups.google.com
Lines: 61
Message-ID: <ded93ac4-99f8-42bb-89b7-a2961f079285@g31g2000yqc.googlegroups.com>
References: <63936638-cb41-4f06-9527-37cac398e3c8@c29g2000yqd.googlegroups.com> <4a82b3a4$1@forums-3-dub.sybase.com> <69f62d30-2115-4a10-a4ee-5173d7b9ff6e@v36g2000yqv.googlegroups.com> <4a832280$2@forums-3-dub.sybase.com>
NNTP-Posting-Host: 129.176.151.28
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1250112976 8720 127.0.0.1 (12 Aug 2009 21:36:16 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 12 Aug 2009 21:36:16 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g31g2000yqc.googlegroups.com; posting-host=129.176.151.28; posting-account=afTtIAkAAAAej8n7XX5x9AnDOQ71NDn_
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!g31g2000yqc.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89763
Article PK: 418950

On Aug 12, 3:13 pm, "Paul Horan[Sybase]"

<phoran_remove@remove_sybase.com> wrote:
> There's nothing I can think of that will automatically make the column grow
> in size as they type.
>
> I can think of a couple of approaches.
> - Write code in the EditChanged event to check the Len() of the data, then
> Modify() the column height when you exceed a specified value.  (Calculating
> that value will be the hard part).
> - Popup a MLE control over the top of the column, simulating the edit
> control, and make that large enough to contain the entire text string.  Then
> do a SetItem() back into the column when that control loses focus.
>
> --
> Paul Horan[Sybase]http://blogs.sybase.com/phoran/

I've got the edit changed logic working sort of. A couple problems
with it. When I set the height based on what is happening in the
current row, the height for all the rows change. I think I can get
around that by checking for maximum height and never setting a height
that is smaller than the tallest one. This looks a little clunky but
at least it allows for data entry. Also, when I come out of edit
changed, the focus was going to row one no matter which row I was
editing. I added code to set focus back on row/column I was typing in
but now it places me at the beginning of that column. Do you know how
to set the cursor to the end of the data that I'm currently editing?

My edit changed code looks like this.

IF dwo.name = 'procedure_note' THEN
CHOOSE CASE len(data)
CASE IS < 20
this.object.procedure_note.Height = 64
this.SetRow(row)
CASE 21 TO 40
this.object.procedure_note.Height = 128
this.SetRow(row)
CASE 41 TO 60
this.object.procedure_note.Height = 192
this.SetRow(row)
CASE 61 TO 80
this.object.procedure_note.Height = 256
this.SetRow(row)
CASE ELSE
this.object.procedure_note.Height = 64
this.SetRow(row)
END CHOOSE
END IF

Without the SetRow(row) command focus was going back to the first
row. Now it goes to the correct row but places the focus at the
beginning of the text so when you type it makes it look like you're
typing backwards.

I appreciate the help you've provided so far.

Thanks, Derek