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

  • Home
  • SEARCH
  • 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 8805087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:46:25+00:00 2026-06-14T01:46:25+00:00

I am using my own validation, but the view of the form (e.g. if

  • 0

I am using my own validation, but the view of the form (e.g. if a component is invalid) should be highlighted or customized within wicket…

So e.g.
I have my Wicket Form

<form wicket:id="inputForm">
         <p>
             <label for="Recipient">Recipient</label>
             <input wicket:id="Recipient" id="Recipient" type="text" size="40"/>
         </p>
         <p>
             <label for="Details">Details</label>
             <input wicket:id="Details" id="Details" type="text" size="40"/>
         </p>
</form>

Then I have my Form.java: Here I set the values of my Java Object “Invoice” and use onValidateModelObjects to override the wicket validation and use my own validation…
This method just calls a simple own created ValidatorObject that takes care of the validation…

public InvoiceForm() {
    ...

    Form<Invoice> form = new Form("inputForm", formModel) {
        /*
         * Validation takes place here
         */
        @Override
        public void onValidateModelObjects() {
            ValidationProcess vp = new ValidationProcess();
            vp.validate("Rules.js", r);
            msg = "";
            if (vp.getConstraintViolations().size() > 0) {

                for (String s : vp.getConstraintViolations()) {
                    msg = msg + s;
                }
            } else {
                msg = "no errors.";
            }
        }
    };

    //adding Textfields to the Form etc...

...
}

What I need: Above you can see that my errorMessages will be saved into the msg String! Now what I want is Wicket to take this String and apply it to the Wicket FeedBackMessage System or however…

  1. I need to get the component that will be rendered at the moment…
  2. I have to set the error Message of this component to my component…

how can I do that?

I guess I need to override some methods, but I dont know which ones and where…

  • 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-14T01:46:26+00:00Added an answer on June 14, 2026 at 1:46 am

    I got it working with the following Code:

    ...
    //Textfields or Form Components GO HERE...
    
            @Override
            public void onValidateModelObjects() {
                ValidationProcess vp = new ValidationProcess();
                vp.validate("Rules.js", r);
                msg = "";
                if (vp.getConstraintViolations().size() > 0) {
    
                    for (String s : vp.getConstraintViolations()) {
                        if (s.contains(";")) {
                            String[] splitted = s.split(";");
                            String elementname = splitted[0];
                            String errorMessage = splitted[1];
    
                            if (elementname.equals("price")) {
                                //SET Error of Component 
                                price.error(elementname + " " + errorMessage + ". ");
                              } else if (elementname.equals("recipient")) {
                                recipient.error(elementname + " " + errorMessage);
                            }
                        }
                    }
                }
            }
    
    //Rest of the Code
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have build my own custom validation framework for WPF using attribute based validation.
I am using an Account Controller which doesnt have its own table but uses
I'm using acts_as_taggable_on, but now have a new requirement: The end goal: Users should
I've created a custom textInput componenet that handles it's own validation using a private
After using a few validation libraries I finally decided to roll my own implementation,
I am using my own custom navigationBar, but i need to access it in
There have been plenty of questions on MVC validation but so far the answer
I have a page with multiple forms on it. Each form has it's own
I'm developing an application using Wordpress as a CMS. I have a form with
I am using user controls (.ascx) that each generate their own specific client validation

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.