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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:05:38+00:00 2026-06-10T17:05:38+00:00

I have a wicket MultiLineLabel which has its contents coming from database. Now I

  • 0

I have a wicket MultiLineLabel which has its contents coming from database. Now I need to display this MultiLineLabel text as a tooltip on hover of a on a page.

Can you please suggest me how I should go about this (i am new to wicket). Should i be going with jquery solution or I should go with adding onmouseover and onmouseout AjaxEventBehaviors on my page?

When I tried the jquery solution I do not know how can i maintain the line breaks in the tooltip.

Please provide me with any examples you have.

  • 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-10T17:05:40+00:00Added an answer on June 10, 2026 at 5:05 pm

    I’ve tested this with a standard label and it works:

    Label ml;
    String msg = "Hello! \n I'm here.";
    add(ml = new Label("multiline",msg));
    ml.add(AttributeModifier.append("title", msg));
    

    UPDATED

    Unfortunately it’s not possible to control the style of the tooltip generated with the attribute ‘title’ because it’s a OS native component. However you could easily adapt the code you have found at http://www.mkyong.com/jquery/how-to-create-a-tooltips-with-jquery/.
    You can put the text of the tooltip in a custom attribute, let’s call it ‘toolTipText’:

    String tooltipMsg = Strings.toMultilineMarkup(yourMsgFromDb).toString(); 
    ...
    yourLabel.add(AttributeModifier.append("toolTipText", tooltipMsg));
    

    Please note that you must use toMultilineMarkup to maintain the line breaks in the tooltip.
    Now you should slightly modify function showTooltip to use the value inserted into the custom attribute:

    var showTooltip = function(event) {
      $('div.tooltip').remove();
    
      $('<div class="tooltip">' + $(this).attr('toolTipText') +'</div>')
                .appendTo('body');
    
      changeTooltipPosition(event);
    };
    

    Finally, you have to tell JQuery to use tooltip with your tag. You must replace “span#hint,label#username'” with the selector matching your component.

    I’ve tested and it seems to work.

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

Sidebar

Related Questions

I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add
I have a Wicket AuthenticatedWebApplication which has several pages and features that need to
I am new to wicket. I have a wicket application class from which has
I have a Wicket page which will dynamically display an image. Let's say the
I occasionally have some long running AJAX requests in my Wicket application. When this
have written this little class, which generates a UUID every time an object of
I have a wicket page , which contains two Spring-managed beans , one is
I have a question regarding Wicket's Datatable. I am currently using DataTable to display
I have an application which needs to accept a POST request from an outside
I have a Wicket application and my pages expire very quickly. Why is this,

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.