Support for position property in html areas

I’m designing a graphical report in html that requires precise positioning of elements on the page (in both x and y direction). I’m trying to use the position property as in the following example:

<html>
<img style = "position:absolute; top: 100px; left: 200px" src= "image.jpg" height = "300" width = "60">
</html>

This works fine in various browser windows, with the image displaced 200px to the right and 100px down from the upper left corner of the page - but in the html area in Servoy, position is ignored and the image falls within the normal page flow (in this case at the upper left corner).

Is there a trick to getting the position property to work in a Servoy html area? If not is this something that can be added to the functionality of the html area as a feature request?

Hi dponti,

Servoy HTML area uses the SUN render engine.
This engine supports HTML 3 and some CSS. Positioning is not supported.
I guess you have to do it the old fashioned way, namely using tables.

Hope this helps.

Thank you, Robert - I guessed (feared) that this might be something external to Servoy… do you or the Servoy dev team know when (or if) Sun’s render engine will support HTML 4?.

For what we’re trying to accomplish, I’m not sure that tables will work - it will certainly require some pretty complex programming to manage all of the row and column spans we’d need. We have a fairly large number of images/image combos and text elements whose number and placement varies with each data record…

One other thought - is there a way to create form elements and get/set form element properties programmatically? If so, that might be a way to programmatically position elements on a page with less pain.

You can use tables to do what you want (as per our conversation at ServoyWorld)… have you tried it?

Yes, Bob - I tried your suggestion for developing an image log report using html and it works well. I even modified your idea some and added some tricks that allow for user definable scaling, data gaps, additional columns, repositioning of columns, etc. To do this I needed to move away from a multitable approach to a single table with multiple columns and 1 row.

However, this exercise got me thinking about expanding your idea into developing fully user customizable graphic reports using html. This is when I thought of using the position property within table cells to make things easier. I’m not sure that what we want to do CAN’T be done with tables, but programmatically, it will be pretty daunting. I’m sending you a PM with an example of the kind of thing that we’d like to try to reproduce using Servoy and we can take the particulars offline. If we’re successful this exercise could make for a useful How-to…

The biggest issues I’m trying to grapple with are placing text elements (where the number of elements, content, font size, etc. are all user defined or come from the database), and instances where we need to overlay elements (eg. place one symbol over another).

Again - is HTML 4 and CSS2 on the horizon for Servoy?

HTML2 and CSS4 - ask SUN… :D

Really.

We don’t have any control over that. We’re using the default SWING controls and HTML stuff.

The user-definable stuff and moving fields around is VERY tricky (at best). You should give a shout out to the folks at adBlocks - as they are PROS at making that kind of stuff work.

In 3.0 you CAN programatically change the size and position of elements - and it will “stick” when in print preview - so it “should” be doable…

Again, I’ve found that HTML is going to be MUCH better/easier than moving individual elements on a form.