Hello
I have a very simple web app that a user fills somedata and the app send a mail using smtpsocket.
The first version was a simple form and worked fine, but later i decided to present the user different forms depending of the user using a computer or a phone.
My problem is with the phone one. As the screen is smaller i splitted the form in two: for this example call them FormDate and FormData.
The first one (FormDate) asks for a date using WebDatePicker from Jeremie Leroy, a date/time (using WebPopupMenu) and a then user press a button that showns the second one (FormData). Here the user fills his email, name, and observations.
The mail (in the mobile Forms) is send using an SMTPsocket control added to the form (Called here MailSocket2)
My problem is that want to clear the forms after the email sucessfuly sent. And added the MailSent event to the MailSocket2 (SMTPsocket) control:
MobileSelectDateForm.DatePicker1.SelectedDate=nil
MobileSelectDateForm.SelectorFecha.DeleteAllRows
And then, when the event is triggered, the app stop with a NilObjectException
If i add a button to the second form that performs the same commands (the ones to clear the first one) it works without error, but with them executed from the MailSent event, the NilObjectException happens.
So:
[quote]DataForm.Button.Action -> Cleans the first form without problem
DataForm.MailSocket2.MailSent -> stops with NilObjectException[/quote]
I also tried to create a method in the first form (DateForm) named ClearForm and do the cleans from it (using Self… and DateForm…) and calling the method from the MailSocket2.MailSent event, but NilObjectException happens also.
Can anyone help/guide me on what i’m doing wrong?
Thanks!