Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Webapplication.FormWidth inaccurate
#1
Hi there.  I have been batting my head against a wall and I cannot seem to find a reliable way to get the form width at the client.  Every browser is different and is really frustrating.  I am trying to place a button to the right of the screen floating and cannot get a correct number to use for the left property.  I tried to anchor right with no left and the button will just flip to the left of the screen whenever there is an ajax event so I have to set the left.  I am using IW Version: 15.1.7.

I have a region with align top that I even tried to get its width in the onRender form event (see code below).  THis has to be in the OnRender Event from what I have been seeing or the numbers are different and worse.

if (Webapplication.FormWidth < Self.Width) then
    iWidth := Webapplication.FormWidth
  else
    iWidth := Self.Width;
  if (iWidth > RegionHeaderTop.Width) then
    iWidth := RegionHeaderTop.Width;


I am using 3 widths here to try to get the smallest to then use for my screen calculation but nothing is 100% reliable.  From what I am seeing, there seems to be reliance of what the width is in design mode to what the last form was that the user loaded.  At least with this code in the OnRender Event the button is somewhat stable.

Is there anyway to RELIABLY get the form width when the CURRENT form is loading in the browser?

Cheers.
Reply
#2
This will not be of help, but I have noticed that any width or height of the form, set at design time, are discarded and in internet browser my form width and heigh are always adjusted to user's max screen width and height, or something. I have come to the conslusion that I shall just use one design for commonly used resolution 1366 x 768 and it is for the user to adjust their desktop to fit the view. Anyway, while browsing various sites, I always have to do that. So why should you care?
Reply
#3
Thank you for your comments.  Yeah that seems to be the case with the local adjustment to the screen size but after the user logs into my application, then I should have the screen size they are using in reliable environment variables.  I even made all the screens the exact same width in design and there is still a variance of some sort out of my control.  For some reason the screen size seems to update based on form so depending what form was loaded before the form I am working on then things are different.  Very frustrating.  All I want to do is float a button to the right of the screen but the system just does not allow this reliably.  

Cheers.
Reply
#4
(01-02-2020, 04:55 PM)bob9999 Wrote: Hi there.  I have been batting my head against a wall and I cannot seem to find a reliable way to get the form width at the client.  Every browser is different and is really frustrating.  I am trying to place a button to the right of the screen floating and cannot get a correct number to use for the left property.  I tried to anchor right with no left and the button will just flip to the left of the screen whenever there is an ajax event so I have to set the left.  I am using IW Version: 15.1.7.

I have a region with align top that I even tried to get its width in the onRender form event (see code below).  THis has to be in the OnRender Event from what I have been seeing or the numbers are different and worse.

if (Webapplication.FormWidth < Self.Width) then
    iWidth := Webapplication.FormWidth
  else
    iWidth := Self.Width;
  if (iWidth > RegionHeaderTop.Width) then
    iWidth := RegionHeaderTop.Width;


I am using 3 widths here to try to get the smallest to then use for my screen calculation but nothing is 100% reliable.  From what I am seeing, there seems to be reliance of what the width is in design mode to what the last form was that the user loaded.  At least with this code in the OnRender Event the button is somewhat stable.

Is there anyway to RELIABLY get the form width when the CURRENT form is loading in the browser?

Cheers.

The change in position during the Async event has been fixed in latest versions. Please update to 15.1.10.

It should fix this behavior
Reply
#5
Other than the issue which has been already fixed, here is how it works:

Every POST request contains 2 fields which carry the browser size information:

IW_width and IW_height

They contain the precise browser dimension, as provided by the browser itself, regardless of the browser used.

These fields are used to adjust the size of the form when it becomes the active form. If you have any Resize event set, it will also be used to set the size of the form, whenever the end user resizes the browser, so your form is notified immediately. If the browse is never resized, your WebApplication.FormWidth and FormHeight properties should contain the exact same value
Reply
#6
Thank you Alexandre!  That is great news.  Unfortunately CG Dev Tools is having a number of issues to fix and I am stuck on 15.1.7 for the time being.  Seems to be allot of render issues with their tools since 15.1 was introduced.  I shall direct my attention to them to get updated.  Glad to hear that once I am on 15.1.10, all will be well.  Cheers.
Reply
#7
I really don't know why CG Dev Tools haven't updated their builds. All issues they have reported to us have been fixed. The last one, more than 30 days ago was promptly fixed and a new build was provided for testing.
They all were small alignment issues (it can be critical from the layout perspective, but no show stoppers).
Reply
#8
Simple intraweb layout uses "absolute" HTML position of controls. Maybe try using templates with advanced css? It can adjust position of your controls to suit you needs.
Here you have a sample css for you to try. It may need some changes.
http://www.mediafire.com/file/7940z6nkfy...e.zip/file
Reply
#9
Thank you.  I will check it out!  Cheers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)