This is part of a simple dialog
self~addEntryLine(27, , 345, 32, 100, 10, "AUTOSCROLLH")
time_date = time('l') date('n')
self~SetEntryLine(27, time_date) / now display the date /
rubbish = self~GetEntryLine(27)
The data is not displayed in field 27
Yet when I use trace i I can see that "rubbish" is set to the value. So what
do I need to do to display the value in field 27 - please/thanks
Try using self~setValue(27, time_date). It works for me. Good luck, -Mark
I had alreay tried that - but Tried again - no luck - I am using oorexx 4.01
on win32 xp machine and I do have an
expose useriddata2. ..... .
use arg useriddata2., ....
ret = self~init:super
if ret = 0 then do
self~ConnectButton(300, "Store_Test_Information") / connect button Update
with a method /
self~ConnectButton(200, "Get_Platform_Data") / connect button IDGETPLATFORM
with a method /
where .... is a lot of stem refs.
I guess I don't know... I'm using REXX 4.01 on 32/64 bits which work equally
well. My similar code worked the first time, then I added code to change the
font and wound up with the following:
Self~AddEntryLine(98, "DefEdit", 344, 424, 446, 168, "AUTOSCROLLV MULTILINE
VSCROLL HIDESELECTION HIDDEN").
DefInputFontHandle = Self~createFontEx("Arial", 14)
Self~setValue(98, RefreshText~changestr("\n", '0d0a'x))
EditControl = Self~getEditControl(98)
Self~SetItemFont(98, DefInputFontHandle, 1)
I didn't have to refresh the field, screen or anything. I'm sorry I don't know
why it's notworking for you. -Mark
Most likely the cause of the problem is data auto detection.
Add this to your program:
and things will work.
Data auto detection will set the values of dialog controls to either the
matching data attribute's value, or to the value of a data stem passed to the
init() method of the UserDialog class.
You are not passing in a data stem:
and you are not automatically creating a data attribute:
(the second argument is omitted.)
What happens is, after initDialog() has executed, when autodetection is on,
the ooDialog framework sets the values of all the dialog controls. Since there
is no data stem, and no data attribute for the edit control with ID of 27, it
gets set to the empty string.
I don't like data autodetection because: it is difficult for people to
understand, it was never documented well, and a lot of it happens under the
covers in the ooDialog framework making programs harder to understand.
Basically you could fix this in one of 3 ways.
1.) Turn autodetection off. The suggestion above.
2.) Use a data stem. You init() method could be:
dataStem.27 = time('l') date('n')
ret = self~init:super(dataStem.)
The above works as you expect. Be sure and do NOT use the initAutoDetection
method I showed
3.) Create a data attribute for the entry line and set its value. This would
work (if there is no initAutoDetection()) method:
self~addEntryLine(27, 'editValue', 345, 32, 100, 10, "AUTOSCROLLH")
self~createPushButton(IDOK, 142, 99, 50, 14, "DEFAULT", "Ok")
self~createPushButton(IDCANCEL, 197, 99, 50, 14, , "Cancel")
self~editValue = time('l') date('n')
Thanks I used your 3rd option this worked for me.
Just a note to any one reading this thread. In this example I gave:
createPushButton() is method that is not available in any release version of
ooDialog, it will be in a future release. For ooDialog 4.1.0 and prior you
would need to use the addButton() method.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.