Discussion:
Checkbox in DataWindow
(too old to reply)
s***@yahoo.com
2005-01-27 19:45:10 UTC
Permalink
I have a datawindow that will typically have 3 to 4 rows, each row will
have a different client address. Each row will also have a default
checkbox. When one is checked, how can I disable the checkboxes in the
other rows. Thanks.
McCools
2005-01-28 15:34:48 UTC
Permalink
itemchanged event - scroll through the rows that are not the 'row'
value triggering the itemchanged event
set them to dw_1.Object.<column_name>.checkbox.off, that way when they
choose one they can not choose another but they can calso change thier
mind.

for i = 1 to this.rowcount()
if i = getRow() continue
dw_1.Object.<column_name>.checkbox.off
next
s***@yahoo.com
2005-01-28 17:02:07 UTC
Permalink
Thanks for the help.

I tried it and nothing happened. I also tried setting the row:

li_row = getRow()
for i = 1 to this.rowcount()
if i = li_row Then continue
dw_sheet.SetRow(i)
dw_sheet.Object.default_indicator.checkbox.Off
next

Any thoughts?
Post by McCools
itemchanged event - scroll through the rows that are not the 'row'
value triggering the itemchanged event
set them to dw_1.Object.<column_name>.checkbox.off, that way when they
choose one they can not choose another but they can calso change thier
mind.
for i = 1 to this.rowcount()
if i = getRow() continue
dw_1.Object.<column_name>.checkbox.off
next
Konstantin Goldobin
2005-01-28 20:45:30 UTC
Permalink
Hello Scot

Fri Jan 28 2005, Scot Mincey wrote to All:

SM> I tried it and nothing happened. I also tried setting the row:

SM> li_row = getRow()
SM> for i = 1 to this.rowcount()
SM> if i = li_row Then continue
SM> dw_sheet.SetRow(i)
SM> dw_sheet.Object.default_indicator.checkbox.Off
SM> next

SM> Any thoughts?

Checkbox is just a presentation style. You have to setItem the value which
corresponds to 'on' or 'off' state of a checkbox. And setRow is not necessary.

Konstantin.
http://www.vsi.ru/~kgold
s***@yahoo.com
2005-01-28 21:32:19 UTC
Permalink
Thanks Konstantin

This worked:

IF Dwo.name = "default_indicator" THEN
for i = 1 to this.rowcount()
if i = getRow() Then continue
dw_sheet.SetItem(i, "default_indicator", "N")
next
End IF

Thomas Humburg
2005-01-28 17:46:08 UTC
Permalink
Post by s***@yahoo.com
I have a datawindow that will typically have 3 to 4 rows, each row will
have a different client address. Each row will also have a default
checkbox. When one is checked, how can I disable the checkboxes in the
other rows. Thanks.
Hi,
what about a global variable (long gl_checkboxrow) which is set to the
actual rownumber when the checkbox in the actual row is checked or -1 if
the row is unchecked (e.g. the itemchanged event of the datwindow control).
Then in your Datawindow Column which holds the checkbox you can code (in
the expression painter) something like if rownum <> gl_checkboxrow and
gl_checkboxrow <> -1 then thisrow.uncheck.
Sorry for the Pseudocode, but at home I dont have acces to a Powerbuilder
Development Environment.
--
TH
mailto:***@gmx.de
Registered Linux user #100649 at http://counter.li.org
s***@yahoo.com
2005-01-28 20:32:03 UTC
Permalink
That makes sense. I'm not sure how to code that in the expression
painter but I'll give it a try. Thanks for the help.
Loading...