lipido / javafxwebview

A demonstration of how to create Java desktop applications with AngularJS and Bootstrap
Apache License 2.0
115 stars 28 forks source link

Values got lost after clicking through application #3

Closed henghx closed 7 years ago

henghx commented 7 years ago

Hi, have done some minor changes to the app and found an issue while clicking through. added a droplist to display the list of fruits you have generated.

e.g.

<select ng-model="fName" class="form-control"
    ng-options="fruit.name as fruit.name for fruit in fruits"></select>

image

after selecting different fruits from the droplist suddenly all fields went blank image

the number of selection before all fields going blank is random, however it always happens. anything i am missing from the guide? Am running it in windows just by double clicking the jar file.

Thanks.

lipido commented 7 years ago

Thank you for pointing out this interesting bug!

After investigation, I discovered that it was related to Java Garbage Collection. I have just pushed 72d162eb3e8cb09b80520b335a76205992a9d2c2 where a more detailed explanation can be found in the commit message.

You have to do two things:

  1. Pull the source to get the changes made in FruitsService class.
  2. Use the getName() in your select, instead of the name field of the Fruit.
henghx commented 7 years ago

Ok Thanks for the investigation and explanation.