B4J Question Order of events

cstangor

Member
Licensed User
Longtime User
Why does "Done" print before "Change" in my log??

Thanks in advance

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.Show
   
    Dim tf As TextField: tf.Initialize("tf")
    tf.Text = "Text1"
    Log ("Done")

End Sub
Sub TF_TextChanged (Old As String, New As String)
    Log ("Change")
End Sub
 

Janos Kerekes

New Member
Licensed User
Longtime User
Hi!

Can you please help me about this?
I faced into the same problem and don't know how to solve it.
In my situation I would like to disable a button after sql query finish and enable when any textbox change.

Is there any way I can avoid this?

Thanks a lot
 
Upvote 0

Janos Kerekes

New Member
Licensed User
Longtime User
Sure.

I prepared a test in eclipse as well and it works fine.

I'm trying to describe that I would like to do.
When btnStart clicked I would like to refresh textboxes from database and after it disable the btnSave.
And when any textbox change then I'd like to enable btnSave.

My problem with the order of the events.
Textbox change event raised after btnStart_Action finished.

That's why btnSave never has disable state.

Thanks a lot.
 

Attachments

  • ChangeEventTest_B4J.zip
    13.9 KB · Views: 330
  • EventOrderTest_Eclipse.zip
    14.6 KB · Views: 291
Upvote 0

Janos Kerekes

New Member
Licensed User
Longtime User
sorry, upload them again.

Could you please help how should I use CallSubDelayed?
 

Attachments

  • ChangeEventTest_B4J.zip
    16.3 KB · Views: 308
  • EventOrderTest_Eclipse.zip
    16 KB · Views: 316
Upvote 0
Top