You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2007/03/21 11:16:35 UTC

OT: disable a page before showing a popup

How to disable a page (change color to light grey and the disabled page will not accept key/mouse events) before showing a popup? modelDialog has this feature. Can I use javascript to do the trick?  Thanks for ideas.
   
  Thanks
  David

 
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.

Re: OT: disable a page before showing a popup

Posted by Werner Punz <we...@gmail.com>.
Dave schrieb:
> Hi Werner,
> Great! Thanks for the ideas.
> I tried modelDialog before. It did not work well. For example, it is
> very slow to open up a modelDialog. I do not understand the reason
> because modelDialog is on the client side.
> I could not find a working example of modelDialog and how it
> communicates with parent JSF page.
> 

Hi Dave, the modal dialog is only slow on certain mainly older browsers
and configuration if you have turned on the fade, this fading effect
brings older configurations on ie6 to a crawl, it is a no issue in
current configurations, you can turn it off (I do not know if the param
is exposed though, it should be)

there is a param normally which describes the transitional effect and
one which describes the transition time,
default to my knowledge is fade and 250ms. (which of course is longer if
the browser engine cannot cope with the fading)

I do not know the names of the params (dont have the code handy yet)
but they should be there, if not please file a jira issue, so that this
is not forgotten and added asap.



Re: OT: disable a page before showing a popup

Posted by Dave <ja...@yahoo.com>.
Hi Werner,
  Great! Thanks for the ideas.
  I tried modelDialog before. It did not work well. For example, it is very slow to open up a modelDialog. I do not understand the reason because modelDialog is on the client side.
  I could not find a working example of modelDialog and how it communicates with parent JSF page.

Werner Punz <we...@gmail.com> wrote:
  Dave schrieb:
> How to disable a page (change color to light grey and the disabled page
> will not accept key/mouse events) before showing a popup? modelDialog
> has this feature. Can I use javascript to do the trick? Thanks for ideas.
> 
You have to use javascript...
What dojo does is basically to push a div with a higer z-index over
the the page, thus layering something on top of it.

in pure html there is no way to do it,...

this is not a working code but you get the idea


  




...

function layerDiv() {
var layer = document.getElementById("layer");
layer.style.width = window.innerWidth;
layer.style.height = window.innerHeight;
layer.left: 0px;
layer.top: 0px;
layer.style.zIndex = 98;

layer.style.visibility = "visible";

}



probably not working but this is basically the idea behind this
layering, you push a div over the visible area, probably instead of the
window width and height you should use the width and height of the
document.body.

and for the greying you have to alter the colors and transparency settings.

the dialog then is pushed as another position absolute div on top of it.
Have in mind that both divs should be located outside of any form
otherwise the absolute positioning will fail on ie6 (welcome to dhtml
browser hell)

but why do you want to make it yourself, the modal dialog does exactly
what you want, and also makes a position fixed for you crossbrowserwise,
if needed?





 
---------------------------------
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.

Re: OT: disable a page before showing a popup

Posted by Werner Punz <we...@gmail.com>.
Dave schrieb:
> How to disable a page (change color to light grey and the disabled page
> will not accept key/mouse events) before showing a popup? modelDialog
> has this feature. Can I use javascript to do the trick?  Thanks for ideas.
>  
You have to use javascript...
What dojo does is basically to push a div with a higer z-index over
the the page, thus layering something on top of it.

in pure html there is no way to do it,...

this is not a working code but you get the idea


<div id="layer" style="visibility: hidden; position: absolute;">
</div>


...

function layerDiv() {
	var layer = document.getElementById("layer");
	layer.style.width = window.innerWidth;
	layer.style.height = window.innerHeight;
	layer.left: 0px;
	layer.top: 0px;
	layer.style.zIndex = 98;

	layer.style.visibility = "visible";

}



probably not working but this is basically the idea behind this
layering, you push a div over the visible area, probably instead of the
window width and height you should use the width and height of the
document.body.

and for the greying you have to alter the colors and transparency settings.

the dialog then is pushed as another position absolute div on top of it.
Have in mind that both divs should be located outside of any form
otherwise the absolute positioning will fail on ie6 (welcome to dhtml
browser hell)

but why do you want to make it yourself, the modal dialog does exactly
what you want, and also makes a position fixed for you crossbrowserwise,
if needed?




Re: OT: disable a page before showing a popup

Posted by Anton Martynov <ma...@reksoft.ru>.
http://jquery.com/demo/thickbox/

see demo & examples

-- 
Best regards,
Anton Martynov,




How to disable a page (change color to light grey and the disabled page 
will not accept key/mouse events) before showing a popup? modelDialog has 
this feature. Can I use javascript to do the trick?  Thanks for ideas.
 
Thanks
David
 Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.