jsf 2 - How to create dialog with percentage height in primefaces -


i create p:dialog component in primefaces size given in percents:

<p:dialog header="dialog" widgetvar="dlg" width="70%" height="70%">   content </p:dialog> 

the code above creates component right width value. height of dialog set minimum value (definitely not 70%).

my question is: how can set percentage height dialog?

i did research , found in primefaces code height value explicitly set 'auto' , height attribute assigned content div. explains why code doesn't work, can overcome issue?

i found way using javascript. component definition should modified:

<p:dialog id="dialog" header="dialog" widgetvar="dlg" width="70%" height="100%">   content </p:dialog> 

in way content fill dialog completely. , following javascipt code should called:

var htmltag = document.getelementbyid('dialog'); htmltag.style.height = math.floor(window.innerheight*0.7)+"px"; 

this resize dialog height 70% of window height.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -