• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

adding image with h:messages tag

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to put an image in front of error messages.

I am setting the error messages in my bean class(using facesContext and displaying that in jsp file using h:message tag.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

did you find a solution for this problem?
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that he will respond sooner or later.

Why don't you just start your own topic wherein you elaborate the problem in detail so that others can help you? This way you get more chance on help than only asking it to one specific person who may not have any moderate knowledge about this.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I had this issue before and I solve it in this way ,

<h:messages infoStyle="background-image:url(D:/yourImage.JPG);"/>

here in my example this style for infoStyle ... you can customize it like this fatalStyle ="background-image:url(D:/yourImage.JPG);".

and you have to make the right speace in the image to let the message to be displayed I mean you have to desgin the image right.

In other words If you want to display like X image , you have to make the image with this X and proper space for the message text.
in my case I knew the messages what they'll display so , I solved it in this way .
Best regards.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The idea is good, but the example is bad. Local file system paths aren't going to work when the client runs at a different machine than the server. You should use URL's. The property name even states "background-url".
[ December 14, 2008: Message edited by: Bauke Scholtz ]
 
ralph soika
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

thanks for the tip with the message infoStyle.
No bad idea :-)
I think I will try this solution.
But I wonder that there is no additional feature in JSF available to solve such a problem. As I understood it is also impossible to use path trough HTML for a message text :-(
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ralph soika:
Hi,

thanks for the tip with the message infoStyle.
No bad idea :-)
I think I will try this solution.
But I wonder that there is no additional feature in JSF available to solve such a problem. As I understood it is also impossible to use path trough HTML for a message text :-(



It is certainly possible with JSF. Indeed not with the basic implementation, but there are additional component libraries available which may be able to do a bit more with the messages. Alternatively, you have the freedom to write your own component for that. That's JSF.
 
ralph soika
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

RichFaces did support such a extension for messages.
http://livedemo.exadel.com/richfaces-demo/richfaces/message.jsf?tab=usage

This seems to be a good solution.
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic