Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP img token with markup and varying size(Dynamic image size in RAP markup img)
RAP img token with markup and varying size [message #1832974] Wed, 30 September 2020 08:56 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
I know that so far, using the img markup token in RAP it is mandatory to specify the width, height and src attributes, which works OK.

However, I'd like to dynamically set the markup to point to any old image url, for which I do not know the width and height at the time of coding, or indeed at runtime, as the image has not yet been fetched.

Is there any way to allow markup to automatically deduce width and height according to the control size that it will go into?

I'd like to say width='100%' for example, and leave height to auto-calculate in order to retain proprotions.

Is this possible, or perhaps as an enhancement to RAP in the future?


---
Just because you can doesn't mean you should
Re: RAP img token with markup and varying size [message #1832982 is a reply to message #1832974] Wed, 30 September 2020 10:16 Go to previous message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
I've sort of got what I want visually by using a Browser control and setting a value like this:
browser.setText("<img style='height: 100%; width: 100%; object-fit: contain' src='...some URL with an image...'/>")

However, I'm assuming that this is quite inefficient and more complex for the page, so potentially not great for performance, compared to direct markup on a Text control?
Not sure if 'object-fit:contain' style is supported universally either?

Plus, I cannot use a Browser control in a Table, which I'll need to do as there could be many images. It needs to be markup really.


---
Just because you can doesn't mean you should

[Updated on: Wed, 30 September 2020 10:19]

Report message to a moderator

Previous Topic:Cannot OSGi-configure ApplicationConfiguration-ServiceComponent
Next Topic:How to catch expire session?
Goto Forum:
  


Current Time: Sat Apr 27 01:35:06 GMT 2024

Powered by FUDForum. Page generated in 0.02877 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top