EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Browser's Height and Width

    Posted Mon July 13, 2015 04:17 PM

    How can I get the browser's height and width so that I can maintain aspect ratio of widgets I am rendering?

    EGLcoder


  • 2.  Re: Browser's Height and Width

    Posted Tue July 14, 2015 05:41 AM

    There are several ways to accomplish this with Javascript, but as Rich UI has dynamic page contents I would advise against using the height.

    Could you describe why you want to maintain the aspect ratio?

    Bram_Callewaert


  • 3.  Re: Browser's Height and Width

    Posted Tue July 14, 2015 01:49 PM

    Hi Bram,

    I have a RUI Handler that displays a Dojo Accordian Container with Dojo Content Panes of  external links and RUI handlers.  The default active Content pane assumes a given height.  If the content pant exceeds the browser height, the remaining panes are not visible and requires the user to scroll the browser page.  Since the content pane has a lot of white space, I am trying to control that percentage within certain limits using the height and width of the browser page.  See attached files.  One displays the full browser with all panes showing.  The other file shows picture of browser with scroll bars.

     

    EGLcoder


  • 4.  Re: Browser's Height and Width

    Posted Fri July 17, 2015 07:53 AM

    I always assume the user can change the size of the browser window, and try to ommit using fixed width or height. Some standard layout components are not well suited for this. I chose to expand some components like the standard box so it can be used with css properties such as width: 100%;. This leaves all of the sizing to the browser.

     

    It seems like you are trying to build a menu with a dojo accordeon container. To accomplish this I used a dojo tree component, which does not put me in a position where I have to determine the height of the window, and manually resize when the users changes the browser window size.  (see attachment).

     

    I have used widget.getpixelheight for some small components, but I do believe that is bad practice and will provide a lot of work in the future if you use this for your entire web application.

    Generally speaking, there are not many websites around that use a page that fits the browser's height.

     

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 5.  Re: Browser's Height and Width

    Posted Mon July 20, 2015 12:39 PM

    Hi Bram,

     

    I appreciate your feedback and I am going to give your suggestion a try.

     

    Kind Regards,

    Rosanne

     

    EGLcoder


  • 6.  Re: Browser's Height and Width

    Posted Tue July 14, 2015 05:55 AM

    Hi,

    There is no built-in function in EGL for this.  Please use javascript externalType to wrap the js to EGL so that you can use it in EGL.

    http://www.w3schools.com/jsref/prop_win_innerheight.asp

    -Jiyong

    HuangJiYong


  • 7.  Re: Browser's Height and Width

    Posted Tue July 14, 2015 02:13 PM

    Hi,

     

    Thank you for the link.  Is this worthy of a RFE?

     

    Rosanne

    EGLcoder