[ https://issues.apache.org/jira/browse/WICKET-6941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17466780#comment-17466780 ]
ASF GitHub Bot commented on WICKET-6941: ---------------------------------------- reiern70 commented on a change in pull request #491: URL: https://github.com/apache/wicket/pull/491#discussion_r776660926 ########## File path: wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/HeadersToolbar.java ########## @@ -71,7 +71,10 @@ for (IColumn<T, S> column : table.getColumns()) { - columnsModels.add(Model.of(column)); + if (column.isVisible()) Review comment: I'm not sure this is the only involved toolbar that needs to be fixed... Did you run `mvn clean install` ? ########## File path: wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/grid/ICellPopulator.java ########## @@ -71,4 +71,8 @@ */ void populateItem(final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> rowModel); + + boolean isVisible(); Review comment: I would prefer this to be be ``` default boolean isVisible() { return true; } ``` and no setter. ########## File path: wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/grid/PropertyPopulator.java ########## @@ -74,4 +75,16 @@ public void populateItem(final Item<ICellPopulator<T>> cellItem, final String co { cellItem.add(new Label(componentId, new PropertyModel<>(rowModel, property))); } + + @Override + public boolean isVisible() Review comment: See my comment above. ########## File path: wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/AbstractColumn.java ########## @@ -37,6 +37,8 @@ private final S sortProperty; + private boolean visible = true; Review comment: See comment about read only ########## File path: wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/grid/ICellPopulator.java ########## @@ -71,4 +71,8 @@ */ void populateItem(final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> rowModel); + + boolean isVisible(); + + void setVisible(boolean visible); Review comment: As said I would prefer this to be only read-only -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@wicket.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Add visible attribute to AbstractColumn to hide/show columns in > DataTable/DataGridView. > --------------------------------------------------------------------------------------- > > Key: WICKET-6941 > URL: https://issues.apache.org/jira/browse/WICKET-6941 > Project: Wicket > Issue Type: Improvement > Components: wicket-extensions > Affects Versions: 9.7.0 > Reporter: Rob Stokes > Priority: Major > > Added isVisible/setVisible methods to ICellPopulator interface to control > rendering of columns in a DataTable/DataGridView. Visible attribute is > checked for the column in AbstractDataGridView and HeadersToolbar. -- This message was sent by Atlassian Jira (v8.20.1#820001)