RAP Display background-image CSS attributes [message #1772077] |
Tue, 05 September 2017 10:18 |
|
Are there plans to support CSS tags background-repeat and background-position for RAP objects?
In particular I would like this on the Display so that I can provide a customised image while the application is starting up (by default the gradient grey background image).
Ideally to support non-repeating in both directions and centred image e.g. "loading application... please wait..." image in the centre of a corporately-colours image.
background-repeat: no-repeat;
background-position: middle;
I'm not sure if there is a valid 'middle' value in CSS for position, but surely there is a way to achieve this?
Thanks, John
---
Just because you can doesn't mean you should
|
|
|
|
Re: RAP Display background-image CSS attributes [message #1772172 is a reply to message #1772130] |
Wed, 06 September 2017 10:15 |
|
Thank-you Chris - that is a better way to do it.
In my application's Configuration#configure method I register any images I need:
...
application.addResource( "splash/loading.png", new ResourceLoader() {
@Override
public InputStream getResourceAsStream( String resourceName ) throws IOException {
return this.getClass().getClassLoader().getResourceAsStream( "splash/loading.png" );
}
} );
...then set the body html:
epProps.put( WebClient.BODY_HTML, "<div id='splash' style='text-align: center;'><br><br><img src='rwt-resources/splash/loading.png'/></div>" );
A hard-coded HTML string like this works OK, but a static html file would be nicer. I couldn't get that to work though.
I've hard-coded the image references with rwt-resources on the front, as I'm unable to call RWT.getResourceManager().getLocation in this method due to invalid thread access, but it is consistent, so that's OK for me.
Thanks, John
---
Just because you can doesn't mean you should
|
|
|
Powered by
FUDForum. Page generated in 0.03712 seconds