Hi,
On Fri, Mar 4, 2016 at 11:55 AM, Harry <[email protected]> wrote:
> Hi all,
>
> I have another question.
> I try to change an icon at a table.
> The icon is a link to open a journal, after click the icon, the journal
> opens in a separate window.
> Now the icon should be change to another icon, so the user can see, which
> journal he has already opened.
>
> All is working well, only the change of the icon is the problem!
> I have no idea how to make it!
>
> Here the code:
> private <I, S> ExtendedGrid<WebHAarHistData, HAarHistSearch> createGrid() {
> ExtendedGrid<WebHAarHistData, HAarHistSearch> extendedGrid = new
> ExtendedGrid<WebHAarHistData, HAarHistSearch>(
> "grid", "haarhist", dp) {
> private static final long serialVersionUID = 1L;
> @Override
> protected void onSubmit(String columnId,
> IModel<WebHAarHistData> rowModel,
> LinkIcon icon) {
> showJournal(rowModel);
> }
> };
>
> SingleLinkColumn<WebHAarHistData> aColumn;
> // if top parameterization is not defined
> if
>
> (!HistWebSession.get().getPtsWebSession().getPtsConstants().definitionIsEmmpty("ProductSettings",
> "aar")) {
> *aColumn = extendedGrid.addSingleLinkColumn("journalLink",
> LinkIcon.JOURNAL);
>
It seems this is the code responsible to create the link with its icon.
You need to re-paint the link after clicking on it to change its icon.
If you want to do this immediately after opening the popup then you have to
use JavaScript.
If you want to render a different icon next time the grid is rendered then
you need to add some condition here and provide another LinkIcon.Xyz.
> // To show journal in Popup
> aColumn.setPopupSettings();
> aColumn.setInitialSize(30);*
> };
> extendedGrid.addColumn("HIST.id", HAarHist.ID_COLUMN,
> HAarHist.ID_COLUMN,
> new ColumnScale(80));
> extendedGrid.addColumn("item", HAarHist.ITEM_COLUMN,
> HAarHist.ITEM_COLUMN,
> new ColumnScale(150));
> extendedGrid.addColumn("description", HAarHist.DESCRIPTION_COLUMN,
> HAarHist.DESCRIPTION_COLUMN,
> new ColumnScale(240));
> extendedGrid.addColumn("ts", HAarHist.TS_COLUMN,
> HAarHist.TS_COLUMN, new
> ColumnScale(80),
> new PtsDateConverter(true));
> extendedGrid.addColumn("changedby", HAarHist.CHANGEDBY_COLUMN,
> HAarHist.CHANGEDBY_COLUMN,
> new ColumnScale(80));
> extendedGrid.addColumn("acceptedby", HAarHist.ACCEPTEDBY_COLUMN,
> HAarHist.ACCEPTEDBY_COLUMN,
> new ColumnScale(80));
> // Computed column
> extendedGrid.addColumn("HIST.journalFileName", "journalFileName",
> "journalFileName", new ColumnScale(120));
>
> /*
> * load grid settings from database, if the session contains no
> settings
> */
> GridSettingServices<WebHAarHistData> gServ = new
> GridSettingServices<WebHAarHistData>(HistWebSession.get());
> GridSetting<WebHAarHistData> gridSetting =
> gServ.getGridSetting(extendedGrid.getGridId(),
> extendedGrid.getGridExtension());
> if (!StringUtil.isEmpty(gridSetting.getSettings()))
> gridSetting = new
>
> PtsWebGritSettingsService<WebHAarHistData>().loadGridSettings(HistWebSession.get(),
> gServ.buildGridSettingKey(extendedGrid.getGridId(),
> extendedGrid.getGridExtension()));
> extendedGrid.createGrid("grid", gridSetting);
> /*
> * advanced table settings
> */
> extendedGrid.getGrid().setClickRowToDeselect(true);
> extendedGrid.getGrid().setClickRowToSelect(true);
> return extendedGrid;
> }
>
> Can anyone help here?
>
> Kind regards
> Harry
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-6-16-How-to-change-an-icon-at-a-data-table-tp4673824.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>