Well, I had to modify your answer slightly for it to work for me and I just want to share my findings in the hope of helping others.
I am not trying to steal the credit for your answer as I don't really deserve or want the credit for it and I just want to share my findings ...:)
Here it goes:
My Dialog uses the onShow attribute to call your function and passes the dialog widget var name to your function:
<p:dialog widgetVar="charts" width="860" height="540" header="chart}" maximizable="true" minimizable="true" showEffect="fade" onShow="fixPFDialogToggleMaximize('charts')">
<ui:include src="/pages/charts.xhtml"/>
</p:dialog>
Your function then uses PF(widgetVar):
function fixPFDialogToggleMaximize(dlg) {
if (undefined == PF(dlg).doToggleMaximize) {
PF(dlg).doToggleMaximize = PF(dlg).toggleMaximize;
PF(dlg).toggleMaximize = function () {
this.doToggleMaximize();
var marginsDiff = this.content.outerHeight() - this.content.height();
var newHeight = this.jq.innerHeight() - this.titlebar.outerHeight() - marginsDiff;
this.content.height(newHeight);
};
}
}
Thank you so much for providing your answer, as it helped me solve the same problem in my use of PF 5.2 Community edition.
Best Regards,
Joe