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 7682137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:29:55+00:00 2026-05-31T18:29:55+00:00

Using Apache Wicket 1.4: I have a panel that calls some setup Javascript in

  • 0

Using Apache Wicket 1.4:

I have a panel that calls some setup Javascript in its renderHead() ajax callback:

public SimplePanel(String id) {

    super(id);

    add(JavascriptPackageResource.getHeaderContribution(SimplePanel.class, "SimplePanel.js"));

    AbstractDefaultAjaxBehavior b = new AbstractDefaultAjaxBehavior() {
        private static final long serialVersionUID = 1L;

        @Override public void renderHead(IHeaderResponse response) {
            super.renderHead(response);
            response.renderOnDomReadyJavascript("init()");
        }

        @Override protected void respond(AjaxRequestTarget target) {

        }
    };

    add(b);
}

Javascript:

function init() {
    var div = document.getElementById("data");
    div.innerHTML = "XXXuniqueXXX";
}

I’m trying to test this using WicketTester:

Panel panel = tester.startPanel(new TestPanelSource() {
    public Panel getTestPanel(String panelId) {
        return new SimplePanel(panelId);
    }
});

tester.assertNoErrorMessage();
tester.assertContains("XXXuniqueXXX");

The renderOnDomReadyJavascript("init()") method is called fine, but init() itself never seems to trigger.

What do I need to call in order to get this DomReady conditional to trigger?

  • 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-05-31T18:29:56+00:00Added an answer on May 31, 2026 at 6:29 pm

    WicketTester just emulates a client (a browser). It doesn’t execute any JavaScript. All you can do with WicketTester is to assert that the content is generated. If you need to execute the JavaScript then you need to use something like http://wicketpagetest.sourceforge.net/ or http://seleniumhq.org/

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

Sidebar

Related Questions

Using Apache Felix, I have an OSGi component I've authored that wraps some middleware
I'm using IntellIJ with Apache Wicket and IntelliJ is showing me that tags like
I am currently using Apache FOP and have a stylesheet (possibly from RenderX) that
So, I have an web-based application that is using the Wicket 1.4 framework, and
I've setup a Wicket + Hibernate + Spring Web application that involves gathering some
I have a Panel that I'm using to display information about a location. I
I am using Apache Felix and its Declarative Services (SCR) to wire the service
I am using apache ant to generate javadoc for my project. I have a
I have a Java EE 6 Wicket application deployed with maven using IntelliJ IDEA
Using Apache, it is quite simple to set up a page that uses basic

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.