Dynamically change the size of the PWB v. 3 dialog window.
Posted: Thu Dec 03, 2015 12:14 pm
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.
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.