Search code examples
simulationanylogic

Update the edit box value Using Database


I have a parameter named "Runtime" that is already defined in a separate class, let's say Runtime = 20;. I am using an edit box to change its value, and the default value is set to 20, so the edit box is also displaying 20.

Now, I retrieve the data from the Excel file for that parameter.

scenario.Runtime= 
(int) selectFrom(sheet1).where(sheet1.parameter.eq("Runtime")).firstResult(false, sheet1.value);

My edit box is displayed in the image below: enter image description here

So, the problem is that the value is getting updated using the Excel sheet (as the statistics calculation shows), but when it comes to the edit box or radio button, they continue to display the previous data. They should receive updates when I import data from Excel.


Solution

  • Just call editBox.setText(codeToReadFromXls) whenever you read from Excel

    Editboxes do not dynamically update themselves as it is normally a user-input changing them. So you need to cater for changes manually