-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Auto set tooltip for FilterBar headers? #56
Comments
Hi, hmmm, I'm not entirely convinced this is a good idea. Just throwing ideas here, please feel free to discuss:
What do you think?
That's actually not a problem since all Vaadin components extend from the Just an idea: What about having an utility function which creates filter text fields instead? Something like: fun filterTextField(column: Grid.Column<*>, tooltip: String = column.header, valueChangeTimeout: Int = 600) {
val tf = TextField()
tf.tooltip = tooltip
tf.valueChangeTimeout = valueChangeTimeout
}
filterBar.forField(filterTextField(this), this)... The thing is that the timeout, theme variant and other things could be project-specific; having that code in vok would then force one project's guidelines onto another. An alternative would be to encourage programmers to develop their own set of utility functions; this encouragement could come from vok's best-practices documentation. However I wonder what the best practice would be... a global function is harder to be discovered since it won't auto-complete. So maybe having /**
* Create a [TextField] with a [TextField.valueChangeTimeout] of 600.
*/
fun <BEAN : Any, FILTER : Filter<BEAN>> FilterBar<BEAN, FILTER>.myProjectTextField(column: Grid.Column<BEAN>): FilterBar.Binding.Builder<BEAN, String, FILTER> {
// ...
} (prefix the textField function with some kind of project name prefix, or some kind of three-letter acronym coming from the company name, so that it's clear that it's project-specific function...) |
Since Personally, I like the idea of helper functions in a library (even if I don't use them or change them). They help show me how things can (should?) be codded and hopefully give me logical defaults (such as a |
Hi 👋 I've decided to remove the FilterBar from vok: the problem was that it was highly complex and still not generic enough to act as a good foundation for custom apps. A much better and simpler approach is to create a FilterBar that's specifically tailored towards the needs of your app: https://www.vaadinonkotlin.eu/databases/#grid-filters I just noticed that the documentation documents Grid filters on two places: in the link above, and also at https://www.vaadinonkotlin.eu/grids/ . I'll update the documentation. |
Should
forField
attempt to auto add the tooltip/title?This is tricky because
forField
acceptsHasValue
butComponent.tooltip
is an extension onComponent
.Here is an example of how I am currently solving it:
The text was updated successfully, but these errors were encountered: