Skip to content

Commit

Permalink
CAUSEWAY-3831: fixes dynamic visibility of search-bar based
Browse files Browse the repository at this point in the history
- by getting the number of table rows  directly from the underlying
model
  • Loading branch information
andi-huber committed Nov 21, 2024
1 parent 4a2c252 commit e72d3ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ protected void onConfigure() {
honorPageNumberHint();
}

/**
* Gets the number of table rows (unfiltered) directly from the underlying model.
* While {@link #getRowCount()} might return zero, when the component was no yet populated.
*/
public int elementCount() {
return _TableUtils.interactive(this).dataElementsObservable().getValue().size();
}

// -- SELECTABLE

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public FilterToolbar(final String id, final DataTableWithPagesAndFilter<?, ?> ta
protected void onConfigure() {
super.onConfigure();
buildGui();
setVisible(getTable().getRowCount() > 1);
setVisible(table.elementCount() > 1);
}

// -- HELPER
Expand Down

0 comments on commit e72d3ea

Please sign in to comment.