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

how to set focus on a dddw column in a dw

2,070 views
Skip to first unread message

Roberto Lammoglia

unread,
Jun 8, 2004, 5:31:31 AM6/8/04
to
Hello,
I have a dropdowndatawindow named dw_sel_dep that contain a column named
cd_department (type dddw with allowing edit property set on).

When i try to use:

dw_sel_dep.setitem(1,"nr_bobina",os_appl.s_null_str) // to add an empty
row
dw_sel_dep.setfocus() // to set focus on

i have not the curson within the cd_department column

Why ?? What is missing ??

TIA
Roby


Williams

unread,
Jun 8, 2004, 6:48:34 AM6/8/04
to
Hi,

Have you tried to use setColumn rather than setFocus?

On 8 Jun 2004 02:31:31 -0700,
in sybase.public.powerbuilder.datawindow

Roberto Lammoglia

unread,
Jun 8, 2004, 10:07:12 AM6/8/04
to
Dear Williams,

as you said me, i tried to use
dw_sel_dep.setcolumn("nr_bobina")
dw_sel_dep.setfocus()

but with previuos wrong effect.

Thank you

"Williams" <wben...@webmail.altensi.fr> wrote in message
news:40c599d6$1@forums-2-dub...

Jerry Siegel

unread,
Jun 8, 2004, 10:51:41 AM6/8/04
to
Set focus on the control first, then set column.
If you want to change the contents of the DDDW, you need to use GetChild to
get a reference to it.

"Roberto Lammoglia" <NOSPA...@becromal.it> wrote in message
news:40c5c867@forums-2-dub...

Roberto Lammoglia

unread,
Jun 8, 2004, 11:25:13 AM6/8/04
to
Dear Jerry,
now I use following notation:

dw_sel_nr_bob.setitem(1,"nr_bobina",os_appl.s_null_str) // to pupulate with
1 null row
dw_sel_nr_bob.setfocus()
dw_sel_nr_bob.setcolumn("nr_bobina")

but i have not focus on the dddw, something was wrong ??

Thank
Roberto

"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message
news:40c5d2cf$1@forums-2-dub...

Jerry Siegel

unread,
Jun 8, 2004, 11:36:44 AM6/8/04
to
Can you get the focus there by clicking on it?

"Roberto Lammoglia" <NOSPA...@becromal.it> wrote in message

news:40c5dab0@forums-2-dub...

Roberto Lammoglia

unread,
Jun 9, 2004, 5:58:21 AM6/9/04
to
Yes, if i click i get the focus.

"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message

news:40c5dd63$1@forums-2-dub...

Jerry Siegel

unread,
Jun 9, 2004, 11:03:34 AM6/9/04
to
I just read the earlier posts again. You need to setcolumn on the parent
column, not the DDDW.

"Roberto Lammoglia" <NOSPA...@becromal.it> wrote in message

news:40c6df94@forums-2-dub...

Roberto Lammoglia

unread,
Jun 9, 2004, 11:31:33 AM6/9/04
to
Jerry, i am sorry but i don't know how to use setcolumn on the parent
column. Can you help me ?

"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message

news:40c726c6$1@forums-1-dub...

Jerry Siegel

unread,
Jun 9, 2004, 2:00:29 PM6/9/04
to
>I have a dropdowndatawindow named dw_sel_dep that contain a column
>named cd_department (type dddw with allowing edit property set on).
>When i try to use: dw_sel_dep.setitem(1,"nr_bobina",os_appl.s_null_str)
> to add an empty row
I'm reading this to mean the DW object for the DDDW is nr_bobina. You need
to SetColumn ('cd_department')

"Roberto Lammoglia" <NOSPA...@becromal.it> wrote in message

news:40c72d55@forums-1-dub...

Roberto Lammoglia

unread,
Jun 10, 2004, 2:57:57 AM6/10/04
to
I am sorry, but my original description was wrong.
Situation is the following:


1) I have an dw object named dw_nr_sel_bobina that have only one field (type
dddw) named nr_bobina.
2) I need to blank this dddw and get the focus in field to allow user insert
some data.
3) When i use

dw_sel_nr_bob.setitem(1,"nr_bobina",os_appl.s_null_str) // where
os_appl.s_null_str = null
dw_sel_nr_bob.setfocus()
dw_sel_nr_bob.setcolumn("nr_bobina")

no focus i got, but when i click (with the mouse) on the dw dw_sel_nr_bob i
got focus.

It's very strange, Jerry.

Thank a lot.

"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message

news:40c75097$1@forums-2-dub...

Jerry Siegel

unread,
Jun 10, 2004, 11:00:58 AM6/10/04
to
The first (only in this case) editable field should get focus when the DW
control gets focus, without needing a SetColumn.
How do you tell that it does not have focus? Are you setting Focus
Rectangle? Can you open the dropdown with Alt+Down Arrow?

"Roberto Lammoglia" <NOSPA...@becromal.it> wrote in message

news:40c80675@forums-1-dub...

Roberto Lammoglia

unread,
Jun 11, 2004, 3:28:19 AM6/11/04
to
After the command dw_sel_nr_bob.setfocus() i have not the cursor (default
cursor) on the editable dddw field. I tried to push Alt+Down Arrow but never
occour. When i click with mouse on field i got cursor on and i can push
Alt+Down Arrow with succesfull beaviour.

"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message

news:40c876ec$1@forums-2-dub...

Jerry Siegel

unread,
Jun 11, 2004, 10:54:14 AM6/11/04
to
Maybe some posted code is stealing focus? Try yield() before setfocus.

"Roberto Lammoglia" <NOSPA...@becromal.it> wrote in message

news:40c95f13@forums-1-dub...

Roberto Lammoglia

unread,
Jun 14, 2004, 4:40:47 AM6/14/04
to
Ok Jerry, now all work fine. Thank you very much for your help !!!
Roberto

"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message

news:40c9c796$1@forums-1-dub...

0 new messages