javascript - Primefaces dialog to set height half screen size -


i using primefaces 5.1. in page use dialog , height attribute. need set screen size 70% of height dialog because screen height differ system need set dynamic height. need javascript or css used set screen based height?

<p:dialog widgetvar="dialogwidget" id="dialogid" position="center,top" height="height set"> ........ </p:dialog> 

first define css class

.autowidthdialog {     width: auto !important; } 

then use above css in dialogbox

<p:dialog id="dialog" styleclass="autowidthdialog" header="my dialog">   ... content ... </p:dialog> 

this old workaround this, may in latest primefaces have added autosize attribute.

another solution can use style style attribute

<p:dialog ... modal="true" style="width:50% !important; height:40% !important; top:25% !important; left: 30% !important;">  </p:dialog> 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -