Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ice-dev] Handling loadInput in newly created items for tutorial

Sure we can do that.  I'm a little confused about how that alleviates the possibility of bugs though.  In the issue you wrote:

> The problem with setupForm() being part of the constructor means that the loadInput operation could be, but might not always be, called before the form is initialized properly or even before the project is properly configured.

Here's what confuses me.  In the old code setupForm did (essentially) this:

    form = new Form();
    ioService = getIOService();
    loadInput(null);

And the new code is going to be:

    form = new Form();
    ioService = getIOService();
    loadDefaults();

Where loadDefaults is going to just be the code from loadInput in the if(fileName == null) block.  Couldn't the situation outlined in your comment still occur with the new code?

Andrew



On Wed, Jul 13, 2016 at 11:00 AM, Billings, Jay Jay <billingsjj@xxxxxxxx> wrote:

Andrew,


Just put your code to read the file in another operation called loadDefaults() and call it from setupForm() for now. Then your template should work fine. That should be sufficient, right?


Jay


Jay Jay Billings
Oak Ridge National Laboratory
Twitter Handle: @jayjaybillings

From: ice-dev-bounces@xxxxxxxxxxx <ice-dev-bounces@xxxxxxxxxxx> on behalf of Andrew Bennett <bennett.andr@xxxxxxxxx>
Sent: Wednesday, July 13, 2016 12:57 PM
To: ice developer discussions
Subject: [ice-dev] Handling loadInput in newly created items for tutorial
 
On GitHub Alex, Jay, and I have been discussing how we can correctly implement a way to load default data into a form (or rather, how it was being incorrectly handled previously).  While the incorrect way was convenient it could cause problems.  The correct version of the code, unfortunately, loses some functionality that was a key component of the tutorial during the item creation portion.  We need a new way to handle that ASAP. 

My thoughts are we can ammend the tutorial docs to have the users import a data file when creating their new item, thus calling the loadInput method in the correct way.  This is not particularly more complex than what was previously being done, but I wanted to see if anyone has other thoughts on the matter.

Andrew

_______________________________________________
ice-dev mailing list
ice-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ice-dev


Back to the top