"Implementing CellTable.Style in GWT 2.7.0 without the use of UiBinder: A Step-By

Recently, I became a part of a GWT application project which was initiated in 2009. My main task is to replace the FlexTable with a CellTable for its sortable column feature. Even though the current GWT version used in the project is 2.7.0, I noticed that some outdated features are still being utilized in the codebase. Being new to GWT, I might be mistaken in my observation.

The functionality of the project seems to be working well so far. However, I am facing challenges as GWT is not allowing me to update the CSS as desired. To resolve this issue, I referred to the GWT dynatablerf sample and tried to add custom CSS to the CellTable using the TimeSlotWidget as a reference:

  interface TableResources extends CellTable.Resources {
    @Override
    @Source(value = {CellTable.Style.DEFAULT_CSS, "CellTablePatch.css"})
    CellTable.Style cellTableStyle();
  }

Following this, I implemented it in my code by initializing the CellTable like this:

 table = new CellTable<TimeSlotListWidget.ScheduleRow>(ROWS_IN_A_DAY,
        GWT.<TableResources> create(TableResources.class));

I attempted to customize the CSS further by creating a separate stylesheet inspired by the GWT CellTable.css. Interestingly, I observed that the TimeSlotListWidget sample includes a ui.xml file utilizing UIBinder, which is currently not integrated into my project.

Upon running my code, I noticed that there is a <style> block injected into the page containing the standard GWT CellTable.css, followed by another <style> block with my custom CSS. Unfortunately, my CSS changes do not override the default GWT styles.

I am puzzled about why the GWT CellTable.css is being inserted and how to prevent it from happening while ensuring my custom CSS takes precedence.

Answer №1

Your issue arises from the fact that in your code, you are reusing the CellTable.Style, and two separate ClientBundles have utilized the same type while each attaching their own CSS to it.

To resolve this problem, consider extending the CellTable.Style interface and implementing it within your bundle:

interface CustomCellTableStyle extends CellTable.Style {}
interface CustomTableResources extends CellTable.Resources {
  @Override
  @Source(value = {CellTable.Style.DEFAULT_CSS, "CustomCellTablePatch.css"})
  CustomCellTableStyle customCellTableStyle();
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The color of the form button should switch when the user hovers over it with their mouse pointer

Here is my form with a custom button: <form action="login_form.php" method="POST" id="login_form"> Email <input name="email" type="text" size="25" placeholder="type your email"/> Password <input name="password" type="text" size ...

What is the process for designing custom width columns using Bootstrap?

I am working on a table with three columns that is styled using the Bootstrap class "table table-striped". However, I need the first column to be 100px in width, the second column to be 400px, and the third column to be 200px. How can I achieve this cust ...

Tips for making a responsive two-column div that dynamically adjusts to its content size

I am working to develop two dynamic columns that automatically grow. The challenge lies in comparing the content of column 1 to column 2. For example, if the content in col1 is greater than the content in col2, a new content should be added to col2. Howe ...

The error at line 72 of proxyConsole.js is: TypeError - Unable to access the 'default' property of an undefined object

I am new to using react redux loading bar and redux forms After clicking a button, I want the loading bar to display. The issue arises when I try to load the loading bar, resulting in the following error message: proxyConsole.js:72 TypeError: Cannot read p ...

The server cannot process the content type 'application/json;charset=UTF-8' as it is not supported

As a newcomer to the Spring World, I am venturing into my first Jquery journey. I am attempting to retrieve JSON data from a JSP page using an Ajax call to the controller. Unfortunately, I encountered an error: org.springframework.web.HttpMediaTypeNotSuppo ...

Interface class in Proguard containing a nested interface

I am facing an issue with proguarding a package in my project. I have an Interface class A which contains another Interface B. When I try to build it using gradle, I encounter the following error: The error message is as follows: symbol: class B loca ...

Guide on implementing a modelpopup window with angularJS

Can someone please provide advice on how to display a model popup window with a button click in AngularJS, without using BootstrpJS? I attempted the code below but encountered an issue. :( html <div> <button ng-click='toggleModal ...

Generating a hyperlink to a specific user ID within a data table

I'm facing an issue with the formatting of my simple table when trying to navigate to user.id. Is there a better approach to this or should I consider moving LinkToUser? All styling has been removed to avoid any conflicts. import styled from 'st ...

Click and keystroke fusion

Greetings everyone, I've been attempting to integrate both click and keypress functionalities into my function, but unfortunately, nothing I've attempted so far has yielded any success. Here's the code snippet: function victoryMessage() { ...

Impressively, GSON halts the process without throwing an exception

While working with the latest Wowza Streaming Engine, I have set out to develop a web application that will allow for dynamic overlays to be injected into incoming frames, similar to Wirecast. To achieve this, I created a client that allows users to add ...

The button's color cannot be modified due to a malfunctioning event script that is not

Seeking an explanation for why my current implementation isn't working. I'm attempting to create a quiz with a multiple choice section where the correct answer turns green when clicked, and incorrect answers turn red. Despite validating the code ...

Overabundance of Open Files Issue when Using Selenium with PhantomJSDriver

My embedded Selenium/PhantomJSDriver seems to have issues with cleaning up resources. When running the client synchronously, it leads to a large number of open files and eventually results in a "Too many files open" type exception. While the program is ru ...

Is it possible for Susy to output a pixel-based span?

As a newbie to Susy, I hope you don't mind if I ask a seemingly silly question... I'm trying to figure out how to calculate responsive padding within a Susy grid. The standard formula is: (target / context) x 100. Is there a way for Susy to pr ...

The CSS files undergo modifications when executing the command "npm run dev"

I've been working on an open-source project where I encountered a bug. Even when there are no images to display, the "Load More" button in the web browser extension still appears. To fix this, I decided to add the class `removeButton` to the button an ...

Determine with jQuery whether the cursor is within a specified region

My webpage has a hidden area that is dynamically set to occupy 60% of the window's width and 70% of its height, centered on the page. This means that the area starts at 20% of the window's width and 15% of its height away from the top-left corner ...

Creating static directories and sub-directories simultaneously with express.js

I have a `views` directory that I made static by using `app.use(express.static('views'))`. The views directory consists of subfolders as listed below- views |-homepage/ | |-homepage.ejs | |-homepage.css | |-homepage.js | |-partials/ | ...

The Test Runner class experiences lengthy build times whenever there is a modification in the code

Whenever I make changes to my Maven project with a Cucumber framework, the Test Runner class takes over 5 minutes to build and launch. Can someone help identify what might be causing this issue and suggest possible solutions? Loading Image : ...

Achieving the position:fixed; effect with a scroll bar

I've designed a webpage with two columns: one on the left and one on the right. On the left side, there are all new orders displayed as HTML links. Upon clicking a link, the order details are fetched via an AJAX call and displayed on the right-hand s ...

Steps for creating a scrollable pane in Internet Explorer

I'm working on creating a new HTML template that features a header that remains fixed at the top of the screen, a footer that stays at the bottom, and the remaining space for text with a scrollbar when needed. The code below functions correctly in Fi ...

What is the best location for storing a settings file in Java?

I developed a JavaFX application that includes individual settings.json files for each user to store their preferences. Currently, I am creating and storing these files in Documents/app_folder/settings.json using the following code: String systemUser = Sy ...