Author: sletellier Date: 2009-02-18 17:11:24 +0000 (Wed, 18 Feb 2009) New Revision: 1835 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx Log: Initialisation bug fixed Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2009-02-18 17:10:47 UTC (rev 1834) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2009-02-18 17:11:24 UTC (rev 1835) @@ -48,6 +48,7 @@ import java.util.logging.Level; import java.util.logging.Logger; +boolean init = false; addPropertyChangeListener("bean", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (evt.getOldValue() != null || evt.getNewValue() == null) { @@ -70,13 +71,22 @@ SetOfVessels setOfVessels = (SetOfVessels)getVerifier().getEntity(SetOfVessels.class); setBean((SetOfVesselsImpl) setOfVessels); if (getBean() != null){ + init = true; jaxx.runtime.swing.Utils.fillComboBox(fieldSetOfVesselsPort,getRegion().getPort(), getBean().getPort()); jaxx.runtime.swing.Utils.fillComboBox(fieldSetOfVesselsVesselType,getRegion().getVesselType(), getBean().getVesselType()); - + init=false; technicalEfficiency.init(_("isisfish.setOfVessels.technicalEfficiency"), getBean(), "TechnicalEfficiency", "TechnicalEfficiencyEquation", "EquationTechnicalEfficiency", fr.ifremer.isisfish.equation.SoVTechnicalEfficiencyEquation.class); getVerifier().addCurrentPanel(technicalEfficiency); } } +protected void portChanged(){ + if (!init) + getBean().setPort((Port)fieldSetOfVesselsPort.getSelectedItem()); +} +protected void vesselTypeChanged(){ + if (!init) + getBean().setVesselType((VesselType)fieldSetOfVesselsVesselType.getSelectedItem()); +} ]]> </script> <Table id='body'> @@ -96,7 +106,7 @@ <JLabel text="isisfish.common.port" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldSetOfVesselsPort" onActionPerformed='getBean().setPort((Port)fieldSetOfVesselsPort.getSelectedItem())' enabled='{isActif()}'/> + <JComboBox id="fieldSetOfVesselsPort" onActionPerformed='portChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -104,7 +114,7 @@ <JLabel text="isisfish.setOfVessels.vesselType" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldSetOfVesselsVesselType" onActionPerformed='getBean().setVesselType((VesselType)fieldSetOfVesselsVesselType.getSelectedItem())' enabled='{isActif()}'/> + <JComboBox id="fieldSetOfVesselsVesselType" onActionPerformed='vesselTypeChanged()' enabled='{isActif()}'/> </cell> </row> <row>