lsatenstein
17th September 2002, 19:19
In Baan 4c4 (static forms) I am trying to use some form of check boxes.
When I am in one of the yesno boxes, and click, I can make the check box appear and disappear. But I get no event to tell me that the field has changed until I leave the field to go to the next field.
Is there a way to make this event occur at the moment the check appears/disappears?
dbinderbr
17th September 2002, 19:46
Hello,
Have you already tried to use the event when.field.changes?
Example:
domain tgyenox check
....
field.check:
when.field.changes:
if check = tgyenox.yes then
do.something()
else
do.another.thing()
endif
NPRao
17th September 2002, 20:22
Hi Leslie,
How are you doing?
You can verify that using the predefined variable -
long attr.changed 4R
Indicates if the current field has changed.
~Vamsi
17th September 2002, 23:07
My frustration at not being able to use check-boxes as radio buttons in Baan IV is documented on Baanfans about three years ago. I believe Baan has done nothing to alleviate the problem :(.
gfasbender
18th September 2002, 00:05
How about something like this?
extern domain tgyenox rbut1.yn |* sim radio button group
extern domain tgyenox rbut2.yn
extern domain tgyenox rbut3.yn
|************************* FIELD SECTION **********************
|* Check Box - Radio Button 1
field.rbut1.yn:
before.input:
if rbut1.yn = tgyenox.no
attr.input = true
else
attr.input = false
endif
when.field.changes:
if rbut1.yn = tgyenox.yes then
rbut2.yn = tgyenox.no
display(rbut2)
rbut3.yn = tgyenox.no
display(rbut3)
endif
refresh()
|* Check Box - Radio Button 2
field.rbut2.yn:
before.input:
if rbut2.yn = tgyenox.no
attr.input = true
else
attr.input = false
endif
when.field.changes:
if rbut2.yn = tgyenox.yes then
rbut1.yn = tgyenox.no
display(rbut1)
rbut3.yn = tgyenox.no
display(rbut3)
endif
refresh()
|* Check Box - Radio Button 3
field.rbut3.yn:
before.input:
if rbut3.yn = tgyenox.no
attr.input = true
else
attr.input = false
endif
when.field.changes:
if rbut3.yn = tgyenox.yes then
rbut1.yn = tgyenox.no
display(rbut1)
rbut2.yn = tgyenox.no
display(rbut2)
endif
refresh()
~Vamsi
18th September 2002, 08:20
Gordon,
I no longer have access to Baan IV. I believe my code was on similar lines to yours. The problem if I remember correctly (and this has been restated by Leslie) is that the when.field.changes does not fire based on a mouse click.
lsatenstein
18th September 2002, 14:34
I thank those who replied. However, in 4c4, as long as the mouse stays on the check box, no change to any other part of the form can or does take place.
I was hoping that when I clicked on one specific y/n check box, that I could simultaneously toggle the state of another. The toggle takes place, but the form/screen update does not.
I will probably change the check boxes for an enum. as then I get the mutually exclusiveness that I was looking for.
Thanks again for all who replied.
Leslie
PS. I did use when.field.changes: and also after.input: