Comments (1)
To put the short story long: to save memory and space and time, the title of a Tab is a single String, not a full-fledged dsweb component extending BaseComponentModel, thus it doesn't automatically inherit all the functionality that the BaseComponent class provides. This is similar to DataTable headers for example.
But, as this issue also shows, requirements emerge from time-to-time to add specific features from BaseComponent to these special labels as well. Stuff like this is seriously painful in the current dsweb architecture, because we have to repeat code over and over special stuff like this.
My proposal for now is somewhat similar to the case of datatable cells that can be single strings or full components (that still doesn't allow the creator of the View to work with the TR and TD elements).
- Extend the Tab class with a BaseComponentModel titleComponent field.
- Extend it with a withTitleComponent(HasComponentModel titleComponent) method that sets this field. This component is required to render as an LI element. This has to be asserted in the Renderer and an exception is to be thrown if not fulfilled.
- Extend the TabSheetRenderer to properly handle this field. Of course, exactly one of title and titleComponent are not null. If the component field is set, the renderer won't create the LI element itself, but it will rely on the given element. The clickhandler is attached anyway.
- TabSheetRenderer should react to any change in these fields and update the view accordingly
This solution will allow any kind of customization of the tab caption.
Please don't forget the GwtTestCase-es :)
from dsweb.
Related Issues (20)
- Some renderers don't properly detach their children
- DepShield encountered errors while building your project
- DepShield encountered errors while building your project
- Reacting to column changes in DataTable HOT 1
- Deferred reaction to selectedIndex changes
- Support all DOM events in BaseComponent
- Checkbox value does not change in special case
- Set InputText selection
- Typeahead renderer doesn't seem to react when the bound model is set to null
- Button rendering issue in table with visible=false HOT 1
- Unable to reset select components
- support AbstractTextColumn
- review: deferred updating of html dom in renderers
- Attribute manipulation HOT 1
- Length property of textfield and textarea HOT 2
- TextProperty update when typing
- Support remote data source in inputtags HOT 3
- Finally dispose disposable renderers
- Support components in table headers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsweb.