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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:13:50+00:00 2026-06-12T12:13:50+00:00

I’m using wicket version 6. I have a form. as contents of the form,

  • 0

I’m using wicket version 6.

I have a form. as contents of the form, I have a FormComponentPanel that contains two DateTimeField‘s (org.apache.wicket.extensions.yui.calendar).

In the class containing the form I have one AjaxButton, and one AjaxLink, both doing the same: reading the models, creating a new object and sending it to some server for processing.

Anyhow,

  • when clicking on the Link my new object is created with the correct values except those newly dates selected with the datepicker

  • when clicking the Button I get some error ([AjaxRequestHandler@1701777932 responseObject [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]) but no further information on the error

well, I addressed the first issue (Link) with trying to add ajax update behavior to it, as suggested here , but the selected date is not updated in the model

the AjaxButton is created and onSubmit overwritten with just calling another method and target.add(form); also setOutputMarkupId is set to true, but it seems that still something is missing

In order to get it to work I’d just need to solve one of the problems, but it would be great if someone has a solution for both problems. Thanks in advance.

edit

public MyPanelIncludingForm() {
  // ...
  form.add(getRangePanel()); // creates a new TimeRangePanel and returns the instance
  form.add(getSubmitButton());
  // ...
}

private FormComponent<String> getSubmitButton() {
  FormComponent<String> submitBtn = new AjaxButton("submitBtn", form) {
  private static final long serialVersionUID = 3005L;

    @Override
    protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
      System.out.println("submit QT ajax button");
      setResponsePage(HomePage.class);
      sendQuery();
      target.add(form);
    }

    @Override
    protected void onError(AjaxRequestTarget target, Form<?> form) {
      System.err.println("error occurred. " + target);
      target.add(feedback);
    }
  };
  submitBtn.setOutputMarkupId(true);
  return submitBtn;
}

// separate FormComponentModel for timeRange

public class TimeRangePanel extends FormComponentPanel<MyRange> {

MyRange range;
PropertyModel<Date> dpFromPM = new PropertyModel<Date>(this, "range.start");
PropertyModel<Date> dpToPM = new PropertyModel<Date>(this, "range.stop");
public RangePanel(String id, IModel<MyRange> model) {
  super(id, model);

dpFrom = new DateTimeField("dpFrom", dpFromPM) {
  private static final long serialVersionUID = 3006L;

  @Override
  protected DateTextField newDateTextField(String id, PropertyModel<Date> model) {

    DateTextField dtf = super.newDateTextField(id, model);

    AjaxFormComponentUpdatingBehavior a = new AjaxFormComponentUpdatingBehavior("onChange") {
      private static final long serialVersionUID = 3006L;
      @Override
      protected void onUpdate(AjaxRequestTarget target) {
        System.out.println("here u " + dpFrom.getModelObject().toString());
      }
    };
    dtf.add(a);
    return dtf;
  }
};

// second DateTimeField as dpFrom

} // end of constructor

@Override
protected void onBeforeRender() {
  range = getModelObject();
  super.onBeforeRender();
}

} // end of class

edit2

this is what the wicket ajax debug window is printing:

INFO: focus removed from 
INFO: focus set on submitBtn11
INFO: Received ajax response (299 characters)
INFO:
<div wicket:id="feedbackQuery" class="feedback" id="feedbackQuery1c"><wicket:panel>
  <ul wicket:id="feedbackul" class="feedbackPanel">
    <li wicket:id="messages" class="feedbackPanelERROR">
      <span wicket:id="message" class="feedbackPanelERROR"></span>
    </li>
  </ul>
</wicket:panel></div>
INFO: returned focused element: [object HTMLInputElement]
INFO: returned focused element: [object HTMLInputElement]
INFO: Response processed successfully.
INFO: refocus last focused component not needed/allowed
INFO: focus removed from submitBtn11

edit3

As I wrote in a comment:

I removed the re-usable components (FormComponentPanel) and now I don’t get an error with the AjaxButton . anyhow, it’s weird, I thought re-usable components should work, even with Ajax; also the models were assigned properly.

  • 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-12T12:13:51+00:00Added an answer on June 12, 2026 at 12:13 pm

    when clicking the Button I get some error
    ([AjaxRequestHandler@1701777932 responseObject
    [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]) but no further
    information on the error

    => You should run Wicket in DEVELOPMENT mode to get a more detailed trace.

    You might simply add in your form a field called:

    range.start

    range.stop

    and use the Object MyRange as property model instead create a new one for each field.
    There is actually no need for that extra cycle. And I don’t think Wicket will write the information back to the MyRange object if you create new PropertyModels for every attribute.

    For example: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/users/UserForm.java?view=markup
    Line 276

    and the corresponding HTML
    http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/users/UsersPanel.html?view=markup
    Line 82

    Sebastian

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.