Author: echatellier Date: 2013-01-28 17:02:08 +0100 (Mon, 28 Jan 2013) New Revision: 61 Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/61 Log: Add molecule behaviour in search page Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java =================================================================== --- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-01-28 15:56:22 UTC (rev 60) +++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-01-28 16:02:08 UTC (rev 61) @@ -25,13 +25,11 @@ import java.util.ArrayList; import java.util.List; -import nc.ird.cantharella.data.model.Lot; import nc.ird.cantharella.data.model.Molecule; import nc.ird.cantharella.service.services.MoleculeService; import nc.ird.cantharella.web.config.WebContext; import nc.ird.cantharella.web.pages.TemplatePage; import nc.ird.cantharella.web.pages.domain.campagne.ReadCampagnePage; -import nc.ird.cantharella.web.pages.domain.lot.ManageLotPage; import nc.ird.cantharella.web.utils.CallerPage; import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior; import nc.ird.cantharella.web.utils.columns.BooleanPropertyColumn; @@ -39,7 +37,6 @@ import nc.ird.cantharella.web.utils.columns.EnumPropertyColumn; import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn; import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn; -import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn.LinkableImagePanel; import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat; import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider; import nc.ird.cantharella.web.utils.security.AuthRole; @@ -112,8 +109,6 @@ setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage)); } }); -// columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol")), "formuleDevMol", -// "formuleDevMol")); columns.add(new AbstractColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol"))) { public void populateItem(Item<ICellPopulator<Molecule>> cellItem, String componentId, IModel<Molecule> rowModel) { cellItem.add(new Label(componentId, "-") Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java =================================================================== --- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-01-28 15:56:22 UTC (rev 60) +++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-01-28 16:02:08 UTC (rev 61) @@ -45,7 +45,6 @@ import nc.ird.cantharella.web.pages.domain.campagne.ReadCampagnePage; import nc.ird.cantharella.web.pages.domain.extraction.ReadExtractionPage; import nc.ird.cantharella.web.pages.domain.lot.ReadLotPage; -import nc.ird.cantharella.web.pages.domain.molecule.ManageMoleculePage; import nc.ird.cantharella.web.pages.domain.molecule.ReadMoleculePage; import nc.ird.cantharella.web.pages.domain.purification.ReadPurificationPage; import nc.ird.cantharella.web.pages.domain.specimen.ListSpecimensPage; @@ -53,6 +52,7 @@ import nc.ird.cantharella.web.pages.domain.station.ReadStationPage; import nc.ird.cantharella.web.pages.domain.testBio.ReadTestBioPage; import nc.ird.cantharella.web.utils.CallerPage; +import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior; import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior; import nc.ird.cantharella.web.utils.columns.BooleanPropertyColumn; import nc.ird.cantharella.web.utils.columns.DecimalPropertyColumn; @@ -63,7 +63,6 @@ import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn; import nc.ird.cantharella.web.utils.columns.MapValuePropertyColumn; import nc.ird.cantharella.web.utils.columns.ShortDatePropertyColumn; -import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn.LinkableImagePanel; import nc.ird.cantharella.web.utils.links.CsvExportLink; import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel; import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat; @@ -591,8 +590,12 @@ setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage)); } }); - columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol")), "formuleDevMol", - "formuleDevMol")); + columns.add(new AbstractColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol"))) { + public void populateItem(Item<ICellPopulator<Molecule>> cellItem, String componentId, IModel<Molecule> rowModel) { + cellItem.add(new Label(componentId, "-") + .add(new MoleculeViewBehavior(new PropertyModel<String>(rowModel, "formuleDevMol")))); + } + }); columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.nomCommun")), "nomCommun", "nomCommun")); columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.familleChimique")), "familleChimique",