Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8115153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:22:21+00:00 2026-06-06T03:22:21+00:00

We are writing an AJAX-heavy Wicket application and have panels that are contributing CSS

  • 0

We are writing an AJAX-heavy Wicket application and have panels that are contributing CSS via renderHead(). However, when panels are being replaced via AJAX – say, via an AjaxTabbedPanel, the header contributions of the old panels remain and pollute the rest of the application. Apart from response bloat, this causes issues when CSS declarations are overly generic and thus result in rendering issues in other areas of the application.

Is there a way around this? Say, a mechanism to re-create the IHeaderReponse when a panel has been replaced / is no longer visible?

For what it’s worth, an example of our header contributor is:

@Override
public void renderHead(IHeaderResponse response) {
    response.renderCSSReference(new SharedResourceReference(SearchMainPanel.class, "Search.css"));
}

We’re using Wicket 1.5.3.

I have had success with a custom label which renders a <link rel="stylesheet" ... /> in the Panel’s <body> markup (i.e., not using header contributors), however IE8 refuses to acknowledge the presence of this CSS – hence having to rethink our strategy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:22:23+00:00Added an answer on June 6, 2026 at 3:22 am

    Each AjaxRequestTarget will receive a new IHeaderResponse that is specifically for that request. The problem you are seeing is due to the fact that a previous request responded with a stylesheet that you no longer want present for that page. The only way to get the browser to disregard a stylesheet that you’ve already rendered on the page is to re-render the page without that file.

    In this case, you can depend on cascading of styles for the first time that you render each tab, because Wicket will load the associated stylsheet when you render that Panel. However, when you return to a tab (Panel) that has previously been rendered, Wicket will not re-render the stylesheet as it has already been loaded. this means that you need to have a way to overcome the limitations of cascading styles.

    The best way to do this is to namespace your styles… meaning you should wrap each panel in a tag with a namespace class (like “tab1” or something more contextually accurate), then you will base all your styles off that class:

    .tab1 .heading {
        font-weight: bold;
    }
    
    .tab1 .description {
        background: blue;
    }
    
    .tab2 .heading {
        font-size: 1.3em;
    }
    
    .tab2 .description {
        background: lightblue;
    }
    

    This will ensure that you are able to distinguish between each tabs individual styles and that any cascading you may need will still work for namespaced selectors

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing WatiN tests to test an Ajax web application and have come across
I'm writing a Javascript app that is getting an HTML document via AJAX, then
I'm writing a PHP application which uses AJAX to submit forms via POST when
I am writing an application that converts an ajax xml response into html using
I'm writing a web app that inserts and modifies HTML elements via AJAX using
Here's the situation: I'm writing a simple AJAX application that performs CRUD functions. When
I'm writing an app that loads in content via ajax using the jQuery.load function.
I'm writing a web app that will be making requests via AJAX and would
I am designing a Java web application that makes heavy use of AJAX (for
I am writing a web application which retrieves a lot of data using AJAX

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.