Hi everybody,
I'm trying to add dynamically a listfield to form. This is working fine, but when I put the RaiseChangeEvent to true, I get an error when I click on any field on the form. Anyone any idea why this is?
If I leave out the line with the smiley (:wow:), the field is added and the form works fine, but no onchange event happens of course ... if I don't leave out the line, the field is added and filled, but I get the following error on the screen of the MFP when I click on any field of the form:
An error has ocurred. The control 'FormDisplayPanel' already has as data item registered. Parameter name: control. Please exit or reset the application and try again.
Here a piece of my code:
'''' ON CHANGE USER ''''''''''''''''''''''''''''''''''''
Sub User_onchange(ByVal eventData As MFPEventData)
Console.WriteLine("User has changed ... try login with no password")
If Checklogin(eventData) Then
Console.WriteLine("Login with no password succeeded")
Dim proj As New ListField
proj.Name = "Projects"
proj.Display = "Projects"
proj.RaiseChangeEvent = True :wow:
eventData.Form.Fields.Add(proj)
GetProjects(eventData)
Console.WriteLine("Projects are loaded.")
Else
eventData.EventResult.ValidationerrorMessage = "Please enter you password"
End If
End Sub
'''' ON CHANGE PROJECT ''''''''''''''''''''''''''''''''''''
Sub Projects_onchange(ByVal eventData As MFPEventData)
Console.WriteLine("Project has changed...")
GetProjectinfo(eventData)
End Sub
Thanks in advance for any help,
Steffen