david7
22nd January 2009, 11:33
Hi,
I added a user option (button) to my customized session. I want it to go to a certain field when a user clicks on it. In Baan IV we used to use input() or to.field() function. In LN it is not working! The focus stays on the same field that was before clicking on the button! Here is my code:
choice.user.1:
on.choice:
input("my.field")
to.field("my.field")
Any help?
-D7
toolswizard
22nd January 2009, 16:35
It might work if you are using the BW directly, but if you are using worktop or webtop it will not function.
david7
22nd January 2009, 17:22
I am using worktop. isn't there any way to do this?
_Ralph_
22nd January 2009, 17:28
I Use to.field on worktop and worked fine.
and i did not use input()
I'm just trying to remember if you need to use the field name as a string...
try this...
choice.user.1:
on.choice:
to.field(my.field)
david7
22nd January 2009, 17:47
Thanks for the reply but 'to.field(my.field)' did not work.
In the documentation it says:
4GL library function.
You can use this function only in 4GL scripts. You can use it in the following event subsections:
after.input, after.display, after.fieldSo I see it is not supposed to work in the on.choice!
Is there any other function/workaround?
- D7
toolswizard
22nd January 2009, 17:48
You could make them readonly using the read only hook, or disable them. Then you would skip over them and get to the field you need.
toolswizard
22nd January 2009, 17:51
This is what is in the LN manual. Since you said you were using worktop I refered to LN
to.field()
Syntax:
function void to.field (field field)
Description
Deprecated. This function is only supported for Baan Windows and its usage is therefore deprecated.
This transfers control of the 4GL engine to the specified field after input to or display of the current field. This overrides the TAB sequence of the form. You can specify the field by using the field number or a string containing the field name.
After handling the specified field, control passes to the next field in the TAB sequence.
Arguments
field field
Context
This function can be used in all script types.
See also
to.form()
Note
In a well-designed GUI, users (and not the application) select and initiate the actions to be performed. Using to.field() removes control from the user. Therefore it does not conform to good GUI design principles.
david7
22nd January 2009, 17:59
Disabling all the fields might work. Is there any other elegant workarounds? I am not sure that the users will like it!
toolswizard
22nd January 2009, 18:42
There is a difference in disableing a field and making it read only. Make sure you use the correct option.