Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabSheet - tabsheet label css change #86

Open
mterjeki opened this issue Feb 12, 2015 · 1 comment
Open

TabSheet - tabsheet label css change #86

mterjeki opened this issue Feb 12, 2015 · 1 comment
Assignees

Comments

@mterjeki
Copy link
Contributor

In some case one option/label of TabSheet should be not clickable. We would like to change manually the css style class of Tabsheet labels.

@gabor-farkas
Copy link

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants