[Suiviobsmer-commits] r1020 - in trunk/wao-ui/src/main: java/fr/ifremer/wao/ui/pages webapp
Author: bleny Date: 2011-02-16 17:11:48 +0000 (Wed, 16 Feb 2011) New Revision: 1020 Log: [#1982] Plan d'?\195?\169chantillonnage : mettre le focus sur la ligne nouvellement modifi?\195?\169e Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java trunk/wao-ui/src/main/webapp/SamplingPlan.tml Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-02-16 16:25:34 UTC (rev 1019) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-02-16 17:11:48 UTC (rev 1020) @@ -62,6 +62,7 @@ import org.apache.tapestry5.SelectModel; import org.apache.tapestry5.annotations.Import; import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; @@ -774,6 +775,9 @@ } } + @InjectPage + private SamplingPlan samplingPlan; + @Log Object onSuccessFromSampleRowForm() throws WaoException { if (cancel) { @@ -796,7 +800,8 @@ serviceSampling.createUpdateSampleRow(sampleRow, boats, getSampleRowLog()); - return SamplingPlan.class; + samplingPlan.setSelectedRowId(sampleRow.getTopiaId()); + return samplingPlan; } else { // Reinitialize professionId for select to avoid selection from existing Profession professionId = null; Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2011-02-16 16:25:34 UTC (rev 1019) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2011-02-16 17:11:48 UTC (rev 1020) @@ -126,35 +126,6 @@ // The company of connected user will be contributed to abstractFilteredPage initCompanyFilter(); } - - /**************************** IMPORT (ADMIN) *******************************/ - -// /** -// * Fichier CSV contenant un plan d'échantillonnage -// */ -// @Property -// -// public boolean canImportSamplingPlan() { -// return user.isAdmin() && !user.isReadOnly(); -// } -// -// @Log -// void onSuccessFromImportSamplingPlan() throws WaoException { -// if (canImportSamplingPlan()) { -// try { -// ImportResults result = serviceSampling.importSamplingPlanCsv( -// samplingPlanCsvFile.getStream()); -// layout.addInfo(result.getNbRowsImported() + -// " lignes du plan importés, " + -// result.getNbRowsRefused() + " refusés."); -// for (String error : result.getErrors()) { -// layout.addInfo(error); -// } -// } catch (WaoBusinessException eee) { -// layout.addError(eee.getMessage()); -// } -// } -// } /**************************** EXPORT **************************************/ @@ -606,10 +577,6 @@ return fullView ? "admin" : "user"; } - public String getParityClass() { - return rowIndex % 2 == 0 ? "even" : "odd"; - } - public String getActionsClass() { return fullView ? "width100" : "width50"; } @@ -642,6 +609,21 @@ return new SimpleDateFormat("MM/yyyy"); } + @Persist + private String selectedRowId; + + public void setSelectedRowId(String selectedRowId) { + this.selectedRowId = selectedRowId; + } + + public String getRowClasses() { + String classes = rowIndex % 2 == 0 ? "even" : "odd"; + if (row.getTopiaId().equals(selectedRowId)) { + classes += " selected"; + } + return classes; + } + /** ------------------------- ACTIONS ---------------------------------- **/ /** Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml =================================================================== --- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-02-16 16:25:34 UTC (rev 1019) +++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-02-16 17:11:48 UTC (rev 1020) @@ -218,7 +218,7 @@ </td> </tr> </t:if> - <tr class="${parityClass}"> + <tr class="${rowClasses}"> <td class="bleft"> <a t:type="actionlink" t:id="filterPeriodDates" t:context="rowIndex" title="Changer les dates de la période par rapport à celles de la ligne">
participants (1)
-
bleny@users.labs.libre-entreprise.org