:: Forum >> Version 2 >>

Combo box popup window larger than assigned value

More information on this topic is available in the documentation section: /aw.ui.combo/.

the popup window is larger than #my-combo-popup (150px).
Is it possible to set the popup window to the same width as I declare (see below) I don't want a white box to the right of my combo box. It hides other elements on my web page.

<style>
#my_combo {width:150px;}
#my_combo-popup {width:150px;height:90px;}
</style>

<script>
var my_combo=new AW.UI.Combo;
my_combo.setId("my_combo");
my_combo.setItemText(["Text1","Text2","Text3","Text4","Text5"]);
my_combo.setItemValue([1,3,6,4,5]);
my_combo.setItemCount(5);
etc ...
</script>
Rimfo
Friday, November 16, 2007
Do you have many external stylesheets (in addition to aw.css)? Do you allow caching of .css files? Do you have any CSS rules for html or body elements in your stylesheets?
Alex (ActiveWidgets)
Friday, November 16, 2007
Could be the use of ID's containing "_" ?
Carlos
Friday, November 16, 2007
I have one more stylesheet no caching is allowed. It contains no rules for HTML or BODY.
To make my problem more understanable:
My combos popup is 150 px but to the right of that is a white area

if i write
#my_combo-popup {width:100%;height:90px;}

the combos popup fills that area.. but I want the popup to be 150px not 100% of the .. eh popup-window? popup-iframe?
Rimfo
Friday, November 16, 2007
a testpage.. try this one and you'll se what I mean..

<html>
<head>
<link href="runtime/styles/mono/aw.css" rel="stylesheet" type="text/css"></link>
<script src="runtime/lib/aw.js"></script>
<style>
#mycombo {width:150px;}
#mycombo-popup {width:150px;height:90px;}
</style>

<script>
function test()
{
var my_combo=new AW.UI.Combo;
my_combo.setId("mycombo");
my_combo.setItemText(["Text1","Text2","Text3","Text4","Text5"]);
my_combo.setItemValue([1,3,6,4,5]);
my_combo.setItemCount(5);
document.getElementById("test").innerHTML=my_combo;
}
</script>

</head>
<body bgcolor=pink>


<div id="test"></div>
<script>
test();
</script>
</body>
</html>
Rimfo
Friday, November 16, 2007
Unfortunately I am not able to reproduce this. I had several users reporting this problem (i.e. popup window size is larger than the listbox) but so far I was never able to reproduce this myself. Your example works fine everywhere I tried (vista, xp, IE6, IE7). I suspect this has something to do with timing (stylesheet caching) - some people were successful with increased timeout in showPopup() method. But so far this is just a guess - I would be grateful if you give me more information what might be special in your configuration and if you see the same problem on other machines.
Alex (ActiveWidgets)
Friday, November 16, 2007
Ah if I change a setting in IE, Temporary Internet Files to Automatic instead of everytime I visit the page it works fine..
Rimfo
Monday, November 19, 2007
However, this is not a solution. Everyone must be able to view the page no matter how their Temporary Internet Files settings are.. Is it possible to somehow reset the width of the popup everytime i click on the arrow that opens the popup? Would that solve the problem?
Rimfo
Tuesday, November 20, 2007
Yes, I agree its a bug and must be fixed. Unfortunately I don't have any good solution yet.
Alex (ActiveWidgets)
Tuesday, November 20, 2007
OK.. hope there is a solution. The combo behaves very strange when temporary Internet Files setting are like this. The popup-window can suddenly appear not under the combo control.. but for example owerlap the control..
Rimfo
Friday, November 23, 2007
How's it going?
Rimfo
Friday, November 30, 2007
oh nevermind.. I solved it myself.
Rimfo
Friday, November 30, 2007
Rimfo,

I just found your post as I have the same issue. Can you tell me what you did to solve the issue.

Thanks
Aaron Todd
Friday, November 30, 2007
Hi Aaron Todd

I've made changes in popup.js in the catalog source/lib/templates/popup.js
in obj.showPopup function
description below

add style='margin:0px' as below
doc.write("</head><body style='margin:0px' onselectstart=\"return false\" oncontextmenu=\"return false\">");

and
replace
width = Math.max(doc.body.scrollWidth, width);
with
width = Math.max(doc.body.offsetWidth, width);

both in the showPopUp and in the setTimeout function a few lines below..
This works fine for me in both IE6,IE7 and Mozilla FF.
Rimfo
Wednesday, December 5, 2007
Rimfo

Thanks a ton!!! That works great!!!
Aaron Todd
Wednesday, December 5, 2007
Aaron Todd

My previous solution was not entirely waterproof. When you want the popup to be larger then the combos control it doesn't work. However I have a solution for that now..

When you declare your combo
add this line
ex:
mycombo.getPopupTemplate().setStyle("width","350");

in the popup.js
replace
var width=ref.offsetWidth
with
var width=this.getPopupTemplate().getStyle("width")==undefined ? width=ref.offsetWidth : width=this.getPopupTemplate().getStyle("width");

this should work..
Rimfo
Thursday, December 6, 2007
I hope this is finally fixed in AW 2.5.2.

http://www.activewidgets.com/general.bugs/2-5-2.html
Alex (ActiveWidgets)
Thursday, July 3, 2008
No it's not. In the IIS, set the content expiration to "Expire Immediately" and you'll get a white box to the right of the combo's popup.
Rimfo
Thursday, October 2, 2008



This topic is archived.

Back to /aw.ui.combo/

Documentation:

Forum search