Dynamically change the size of the PWB v. 3 dialog window.

Questions and comments about currently under development PWB v3

Moderators: Tyler, Scott

Post Reply
jqjansse
Observer
Observer
Posts: 8
Joined: Mon Aug 09, 2004 1:53 am
Location: Vrije Universiteit Brussel, Brussels, Belgium

Dynamically change the size of the PWB v. 3 dialog window.

Post by jqjansse »

Dear Scott,

I am trying to change the size and location of the dialog windows in PWB v. 3 dynamically, based on the screen-size of the machine PWB is running on. My intention is to center the popup dialog windows generated by PWB on any screen whatever its number of horizontal and vertical pixels. I am using file policy.html as the guinea pig and have tried to change the contents of the string values named "value" in the following lines by adding some JavaScript code:

--- code from policy.html ---
<input type="hidden" id="DialogHeight" value="480" />
<input type="hidden" id="DialogWidth" value="640" />
<input type="hidden" id="DialogLeft" value="100" />
<input type="hidden" id="DialogTop" value="100" />
--- end of code from policy.html ---

I admit that I am not a programmer and have little experience with HTML and JavaScript, but I am seemingly unable to make PWB v. 3 accept changes to the contents of these string values, except by changing the contents of the lines above manually and that is, of course, all but dynamic.

I have tried changing the string values named value using the JavaScript document.getElementById method to no avail. I have even tried removing the lines above from the HTML code and recreate the hidden inputs in JavaScript using the document.createElement method, but that also has not the desired effect on what PWB v. 3 does with the dialog box.

I am effectively able to change the values, but PWB v. 3 does not seem to register them (or even find the newly created hidden inputs) and I end up with a smallish, but centered dialog window with the "OK" and "Cancel" buttons not aligned correctly as configured in the CSS style section I also added. But that is another story...

Are these kind of changes (adding JavaScript code and CSS styles) to the contents of the PWB v.3 .html dialog windows possible or even allowed at all?

TIA for your reply.

Regards,

Jan J.
Jan Janssens
Universiteitsbibliotheek / University Library
Vrije Universiteit Brussel / Brussels Free University
Pleinlaan 2
B-1050 Brussel
BELGIUM

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Dynamically change the size of the PWB v. 3 dialog windo

Post by Scott »

Unfortunately PWB reads the values when the message is first shown as the message window is an actual Windows dialog and not a Internet Explorer/Chrome type window. To make it dynamic you would need to use a server side script such as PHP to adjust the values before presenting it to PWB.

Adjusting the values after the Window is shown with JavaScript may work if you add a page refresh after adjusting the values.

--Scott

Post Reply