B4J Question Form load life cycle

dieterp

Active Member
Licensed User
Longtime User
I've noticed that when you load a form (In this instance frm.ShowAndWait) it appears that the order the code gets executed is different to other general platforms. Here are some steps to describe what I mean:
  1. I create a customlistview and populate it with checkboxes where the label is the name and surname of a user i get from a database
  2. There is a field in the database that tells me whether the checkbox must be checked or not when the list is populated
  3. Only once the list has finished loading everything, does the code then go to the chkUsers_CheckedChange sub and run any code that is in that in that sub where the user is checked
Generally in step 2 above, when the checkbox is checked during that process the code would normally break away at that point to the chkUsers_CheckedChange sub and run through the code and then return to populate the next list item. Is this how the code is supposed to execute, or am I missing something?
 

EnriqueGonzalez

Expert
Licensed User
Longtime User
JavaFx (not b4j) has a queue system for events raised, it is possible that the checkbox event is sent all the way to the end of the process.

General rule, you should not wait for a specific event to happen during a long run process.
But the property it is actually changed, so your checkbox will have the last value you put in any part of the process.
 
Upvote 0

dieterp

Active Member
Licensed User
Longtime User
Thanks Enrique. I'm getting more used to how Javafx handles events now and adjusting the code as I go along
 
Upvote 0
Top