0

The composite component approach addresses migration of "rich:spacer" tags in .xhtml pages to RichFaces 4.

But we also have custom component using HtmlSpacer like this:

HtmlSpacer spacer = new HtmlSpacer();
spacer.setWidth("20");

How can it be migrated to RichFaces 4?

Andrey
  • 6,526
  • 3
  • 39
  • 58

1 Answers1

0

An appropriate/preferable solution would be to write some CSS for your custom component instead of using spacer image approach.

But if going old-style way, straightforward alternative could be something like this:

HtmlGraphicImage spacer = new HtmlGraphicImage();
spacer.setName("images/spacer.gif");
spacer.setWidth("20px");
spacer.setHeight("0px");
Andrey
  • 6,526
  • 3
  • 39
  • 58
  • http://stackoverflow.com/questions/11988415/what-is-the-jsf-resource-library-for-and-how-should-it-be-used – BalusC Jun 18 '15 at 06:48
  • Thanks @BalusC, that makes complete sense. Just assuming that OP uses https://developer.jboss.org/wiki/SpacerImplementationForJSF2OrRichFaces4 for replacing rich:spacer, which does exactly library="images" name="spacer.gif". – Andrey Jun 18 '15 at 11:33
  • Just point that starter on above link too. Just use `name="images/spacer.gif"`. – BalusC Jun 18 '15 at 12:31