Hi all,
I am creating a form that requires a number of StringEdit controls with
folder (not file) lookups, these fields are not linked to fields in any
table, so they cannot inherit settings such as the lookup icon. The lookup
button should permanently be visible (so I am setting 'LookupButton' to
'Always' on the control).

I have tried declaring a FilePath variable in the classDeclaration,
updToAvnPath. I then set an initial value for this string in the init
method. I then provided the following method as the DataMethod on the
control:

public FilePath updToAvnPath(FilePath _updToAvnPath = updToAvnPath)
{
    updToAvnPath = _updToAvnPath;
    return updToAvnPath;
}

Finally, I override the lookup method on the control as follows:

public void lookup()
{
    ;
    updToAvnPath = Winapi::browseForPath(element.hWnd());
}

This causes the folder dialog to pop up when the lookup button (which does
not have the correct icon.. ) is pressed, assigning a value to updToAvnPath
when the user makes a selection, but the value does not get reflected on the
form (the initial value also does not get displayed on the form). If I add
the display keyword to the updToAvnPath access method, the initial value is
copied to the control, but the control is not editable and the lookup button
is not available!

What is the correct way to do this? Keeping in mind that this control can
not be associated with a value in the database.

Regards,

Matt Benic
Axapta Developer
UTi Sun Couriers Division


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to