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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:10:12+00:00 2026-06-07T10:10:12+00:00

How do I correctly create internationalized labels for my form components so that when

  • 0

How do I correctly create internationalized labels for my form components so that when displaying feedback messages an internationalized field name is displayed instead of the name of the field in the java code?

I’ve read this:

https://cwiki.apache.org/WICKET/everything-about-wicket-internationalization.html

as well as the documentation for wicket’s xhtml tags:

https://cwiki.apache.org/WICKET/wickets-xhtml-tags.html

<label wicket:for="name">
     <wicket:label>
         <wicket:message key="label.name"/>
     </wicket:label>
</label>
<input wicket:id="name" type="text" wicket:message="placeholder:label.name" />

This results in the following error:

Last cause: Expected close tag for '<wicket:label>' Possible attempt to embed 
component(s) '<wicket:message key="label.name"/>' in the body of this 
component which discards its body

If I replace the wicket:message with some arbitrary text it displays the text in any associated feedback messages.

(There’s a related jira issue: https://issues.apache.org/jira/browse/WICKET-3903 however I still do not understand what has been done to fix this and what I must do …)

Just found out there is a way to do this in java:

add(new TextField<String>("name").setRequired(true).setLabel(new Model<String>(getString("label.name"))));

Is it possible to somehow do this in a more comfortable way?

  • 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-07T10:10:14+00:00Added an answer on June 7, 2026 at 10:10 am

    I just tested the following:

    <form wicket:id="form">
            <label for="input"><wicket:message key="input">some input</wicket:message></label>
            <input wicket:id="input" type="text" name="input">
            <input type="submit" value="submit">
     </form>
    

    And in the java class:

    Form<HomePage> form = new Form<HomePage>("form"
                                  , new CompoundPropertyModel<HomePage>(this));
        wmc.add(form);
    
        TextField textField = new TextField("input");
        textField.setRequired(true);
        form.add(textField);
    

    In the property file I provided:

    input=SomeInputField
    

    This led to the following screen (if I leave the requiered field empty and press submit.

    enter image description here

    Is this what you are looking for?

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

Sidebar

Related Questions

I am trying to create a form in my view that will route to
Do I suppose correctly that it is not possible to create view with parameters?
How do you create menu items in Gtk# that are correctly handled by all
Im trying to create linked-list insert function that takes a list (or more correctly
I'm trying to create an exit button that correctly closes the GUI I have
I can't seem to get the Ruby Shoes packager to correctly create an exe
I'm trying to correctly write TSQL to create a new table containing the following
I've used minidom to create an XML and it comes out correctly but I
This is just a quick question to understand correctly what happens when you create
Strange... When i create an HREF to a .doc, the browser behaves correctly and

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.