Page 1 of 1

width setting on the 5250 div

Posted: Wed Aug 12, 2015 1:20 pm
by esdaled
We have a ProfoundUI display file which is being shown as part of a Genie macro.

The display has a horizontal scroll bar shown at the bottom of the page because the width setting on the 5250 div is being set to 17138px as show below.

Code: Select all

<div class="insideDiv" style="position: relative; width: 17138px;" id="5250" tabindex="0">
When other ProfoundUI display files are shown the width is set to 942px.

What controls the width in the 5250 div?

Re: width setting on the 5250 div

Posted: Wed Aug 12, 2015 1:26 pm
by Brian
That honestly depends on the skin being used. Are you using a custom skin or one that was shipped with the product?

Re: width setting on the 5250 div

Posted: Wed Aug 12, 2015 2:17 pm
by esdaled
We are using a custom skin which was based on the blue skin.

I have attached our start.html page

Re: width setting on the 5250 div

Posted: Wed Aug 12, 2015 2:28 pm
by Brian
In the original "Blue" skin, there was a section of JavaScript code in custom.js that controls this. The original code was as follows:

Code: Select all

// Customize 132x27 mode
  if (pui.genie.displaySize==132 && !pui.genie.config.useAjax) {
    pui.genie.middleDiv.style.height = "640px";
    getObj("5250").style.position = "absolute";
    var position = (screen.width - 1060) / 2;
    if (position < 0) position = 0;
    getObj("5250").style.left = position + "px";
  }
  else {
    if (pui.genie.middleDiv != null) {
      pui.genie.middleDiv.style.height = "";
      pui.genie.middleDiv.style.width = "";
      getObj("5250").style.position = "relative";
      getObj("5250").style.left = "";
      getObj("5250").style.width = "";
    }
  }
It is likely that some of your customizations have thrown this calculation off somehow. I would recommend finding this code and debugging the JavaScript to diagnose the issue.

Re: width setting on the 5250 div

Posted: Wed Aug 12, 2015 2:34 pm
by Scott Klement
I don't see where this code is setting the width of the 5250 div? I see it checking 'screen.width' and setting the height and left positions, but not the width. Am I missing something?

Re: width setting on the 5250 div

Posted: Wed Aug 12, 2015 3:01 pm
by Brian
Ah, you are correct. I misread it. It is setting the left positioning, not the width. Sorry for the misinformation. That's what I get for trying to answer a question while on the phone.

It is likely being set in the JS somewhere.

Re: width setting on the 5250 div

Posted: Wed Aug 12, 2015 3:33 pm
by esdaled
I may be wrong but I don't see anything in our js.

On thing that I have noticed is that our start page wraps the 5250 inside a "middle" div. However, the id of the middle div is being changed to the record format name of the last genie screen displayed (Although if the last genie screen displayed was WRKSPLF it is set to "{Unnamed-Screen}").

I do see some obfuscated code in genie.js which does a getElementByID("middle"), This may be related as this div also has the width set to 17138px.

Re: width setting on the 5250 div

Posted: Wed Aug 12, 2015 4:35 pm
by Scott Klement
genie.js does the following:

if the pui.genie["setContainerWidth"] variable is true (true is the default) then it will:

a) When rendering a Rich Display, set the width to that of the rightmost edge of the rightmost DOM element. The logic to set the width when rendering a Rich Display can be read in the open source version of Profound UI by reading the "pui.getDimensions" routine in runtime/dspf/render.js, online here:
https://github.com/ProfoundLogic/profou ... /render.js

b) When rendering a 5250 display, set the width to the pui.genie["containerWidth"] configh variable. This is "" (empty) by default, but can be overridden in a customer's script.

Re: width setting on the 5250 div

Posted: Thu Aug 13, 2015 7:50 am
by esdaled
I have found the problem. The ProfoundUI rich display file is language enabled and one of the labels was padded on the right with spaces in the puitransp file. Removing the trailing spaces in the translation file solved the problem. The width of the display is now 942px as expected.

We have built our own interface for maintaining the puitransp file and this label may have been created when we were developing the interface and not trimming the entered values.

Thanks,

Dave

Re: width setting on the 5250 div

Posted: Thu Aug 13, 2015 9:21 am
by Brian
Glad you found it. That is not somewhere I would have thought to check. I will add it to my list of gotchas.