This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> > want to do, I'm just passing this along. Here's something else I > discovered: > > I have a custom ScatterDisplay which extends DisplayControlImpl, and > overrides the init(List choices) method. Here's what I do in the init: > > FlatField X_field = (FlatField) > getDataChoice().getData(getDataSelection()); > popupDataDialog("select Y Axis field", container, false, null); > > > try { > java.lang.Thread.sleep(2000); > } catch (Exception e) { > } > > FlatField Y_field = (FlatField) > getDataChoice().getData(getDataSelection()); > > The first line gets the Data initially bound to the List of choices = 1. > Then I popup the DataDialog so the user can select the YAxis data. > The IDV tries to automatically replace the original DataChoice with > the last one selected, and initalizes the Data. You might be asking, > what's the sleep for? We'll there's a sync problem somewhere in t > the IDV, because If I don't do this, I get the same X Data again. > > I notices that the thread that calls popupDataDialog blocks until > the user selects, how is this done, is there a wait() somewhere or > a loop? > > Is this right way to extend the IDV framework? > Hi again Tom, I think the problem is that popupDataDialog ends up adding the selected data in a thread: Misc.run(new Runnable() { public void run() { try { addNewData(clonedList); } catch (Exception exc) { logException("Selecting new data", exc); } } }); I am refactoring this code so you can now directly call: List<DataChoice> choices = selectDataChoices(dialogMessage, from, multiples, categories); Instead of calling popupDataDialog. This just returns the list of selected choices. I'm checking this in right now. -Jeff Ticket Details =================== Ticket ID: VML-828620 Department: Support IDV Priority: Normal Status: Closed