Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

autosize height

355 views
Skip to first unread message

Derek

unread,
Aug 11, 2009, 8:21:26 PM8/11/09
to
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]

unread,
Aug 12, 2009, 8:20:52 AM8/12/09
to
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" <dro...@mayo.edu> wrote in message
news:63936638-cb41-4f06...@c29g2000yqd.googlegroups.com...

Derek

unread,
Aug 12, 2009, 8:58:07 AM8/12/09
to
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]

unread,
Aug 12, 2009, 4:13:52 PM8/12/09
to
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" <dro...@mayo.edu> wrote in message

news:69f62d30-2115-4a10...@v36g2000yqv.googlegroups.com...

Derek

unread,
Aug 12, 2009, 5:36:15 PM8/12/09
to
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

0 new messages