Error message: "Issue encountered when trying to override styles in GWT DataGrid - ImageResource method value('cellTableLoading') not found"

Attempting to customize styles for the GWT DataGrid component following the instructions provided here.

Here is my interface:

public interface DataGridResources extends DataGrid.Resources {
@Source({ DataGrid.Style.DEFAULT_CSS, "myDataGrid.css" })
DataGrid.Style dataGrid();
}

public static final DataGridResources dataGridResources = 

Creating a Datagrid instance using the Interface:

GWT.create(DataGridResources.class);

static {
    dataGridResources.dataGrid().ensureInjected();
}

...

dataGrid = new DataGrid<User>(10, dataGridResources);

Encountering the following error:

Rebinding xxx.DataGridResources
-Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
--Creating assignment for dataGrid()
---Creating image sprite classes
----Unable to find ImageResource method value("cellTableLoading") in xxx.DataGridResources : Could not find no-arg method named cellTableLoading in type xxx.DataGridResources
--Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator' threw an exception while rebinding 'xxx.DataGridResources'
-Deferred binding failed for 'xxx.DataGridResources'; expect subsequent failures

Answer №1

This solution has been proven effective.

public interface Resources extends DataGrid.Resources {

  interface Style extends DataGrid.Style { }

  @Source(value = {DataGrid.Style.DEFAULT_CSS, "myDataGrid.css"})
  public Style dataGridStyle();
}

There is no need to manually call ensureInjected() as it will be taken care of by DataGrid.

However, an issue appears in the error log: it seems to be searching for the style cellTableLoading which belongs to CellTable.Resources, not DataGrid.Resources. Is there a possibility that there are extraneous CSS classes in myDataGrid.css that were not originally defined in the interface?

Perhaps you switched from using CellTable to DataGrid simply by renaming the CSS file without updating the inner class names.

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

Is there a way to align the content in my Flexbox rows to the top of each cell, resembling a table layout?

I am currently facing challenges in aligning my layout correctly, especially on resolving the final adjustments. In the scenario described below, everything seems to work fine when the message_data <span> elements contain a single line of data. Howe ...

Challenges with jQuery parent method reaching the grandparent element

Hey, I'm a newbie to jQuery and I'm trying to make changes to divs that are two levels above the function trigger: Here's my initial attempt: I try to locate the closest '.node' which is the parent of all other divs and then modif ...

Troubleshooting the Height Problem in Bootstrap Divisions

Can someone help me align the height of the alert box with the input field? I've tried using Bootstrap classes but can't seem to get it right. I attempted using col-mb-4 in the alert class, but the height alignment is still off. <link rel= ...

What is the complete list of features that ColorTranslator.FromHtml() supports and what are the reasons behind its departure from traditional CSS color interpretation guidelines

I'm looking to enhance an API by providing users with the ability to specify the color of something. I want it to accept various representations of colors, such as hex codes and CSS colors. Initially, I thought that ColorTranslator.FromHtml() would fu ...

Chrome (on both Linux and Windows) is not compatible with CSS

Here is the code snippet I am currently working with: <style type="text/css"> div { margin: 100px auto; width: 0px; height: 0px; border-right: 30px solid transparent; border-top: 30px solid red; border-left: 30px solid red; border-bottom: 3 ...

Responsive tables in Bootstrap 4 that are nested

I am currently utilizing Bootstrap 4. I have a complex table structure where I want only the second column and onward to be scrollable. The challenge is making this specific part of the table responsive while keeping the rest static. I attempted to nest a ...

Creating an overlay with CSS hover on a separate element and the ::before pseudo class

Issue: I am struggling to display the overlay when hovering over the circle element, rather than just the image itself. I have attempted to achieve this using CSS, but can't seem to make it work as intended. Any guidance and examples using JavaScript ...

Different methods for creating a dynamic asp.net web Grid for mobile user interface (utilizing block display and selective column hiding)

Currently, I am developing a web application using asp.net mvc-4 and incorporating bootstrap 2.0 into the design. The main tool I am utilizing in almost every controller is the asp.net mvc web grid due to its efficient sorting, paging, and minimal code req ...

Set the text to be centered and aligned to the left margin in an HTML document

After creating a bullet-point list in HTML, I centered the text and bullet points. However, when I center the text, the bullet points become staggered. Is there a way to keep the text in a straight line on the left while still centering it? https://i.ssta ...

I am having trouble centering my navigation links on the page

I've tried everything, but I just can't seem to center my navigation bar properly. I'm new to HTML/CSS and struggling with this issue. If you have any suggestions on how to fix it, I would really appreciate your help! Check out the image of ...

When transformed into clickable links, the list items start piling up on

Here are two groups of code along with a straightforward question that most people can answer easily, but still worth asking. Below is the initial piece of code with working CSS implementation: <div class="subTopHolder"> <ul class="language ...

How to Use CSS to Crop a String from the Middle

My file has a long name and I am using CSS text-overflow: ellipsis to crop it. <style> #fileName { width: 100px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style> <div id="fileName"> ...

The Width of Material UI Divider

Currently seeking a method to increase the line thickness of the Material UI Divider, whether by stretching horizontal lines vertically or stretching vertical lines horizontally. I have reviewed the documentation for Material UI v5 on https://mui.com/mate ...

Is anyone interested in incorporating Bootstrap 4.1.2 into their project and utilizing the npm package manager for easy integration?

I am trying to integrate Bootstrap 4.1.2 into my project using npm as a package manager. Can someone assist with this? ** note: I prefer to have Bootstrap locally rather than using BootstrapCDN as shown below: <link rel="stylesheet" href="//maxcdn.boo ...

Triggering jQuery events can be customized by excluding certain elements using the

Is there a way to hide the div "popu" when clicking on the img "tri"? I've tried using .not() since the img is a child of the div popu, but it didn't work. Also, I need to make sure that clicking on the div "textb" does not trigger the hide actio ...

Customizing the scroll bar appearance in Internet Explorer using CSS styles

Encountered an issue with the scroll bar on iPad and browsers. The style is working well with Opera, Safari, Firefox, and Chrome, but it doesn't display properly in Internet Explorer, appearing a strange horizontal scroll bar on the page as well. You ...

The div container is not expanding to full width on mobile screens when using Next.js and Tailwind CSS

My goal is to make my div stretch or go full width similar to the table on my page. I have experimented with max-w-full, w-screen, and w-full, but the div is not extending all the way... https://i.stack.imgur.com/8BJnI.png This is the code for my page. ...

Interactive webpages with dynamic HTML content, similar to the design of popular platforms such

Explore the source code of Dropbox's homepage or any Soundcloud page. They utilize various scripts and minimal pure HTML content (article, main, p, div). This method of generating pages is referred to as dynamic content/HTML. The main function seems ...

Specialized hover mission

Do you have a question? Imagine you have 3 spans where the default color is black. When you hover over a span, its color changes to red. But what if I told you that at the start, the first span has an orange color. Now, I want to hover over the orange on ...

What is the best way to ensure that the text remains visible on the image?

Is there a way to maintain the static 'BUY NOW' tag on an image while allowing other elements to be dynamic? Any suggestions on how to achieve this within an img tag?https://i.sstatic.net/6eLoN.jpg ...