PF 7.0.RC3 // Dialog Framework: How to update Dialog Height on validation errors?

UI Components for JSF
Post Reply
benjamin.nowak
Posts: 4
Joined: 13 Feb 2018, 11:56

12 Mar 2019, 15:06

I'm using the Dialog Framework in Primefaces 7.0.RC3 and I have the height set to the default (auto) which is fine until I click the Add button and it displays a validation message. Now the dialog height is too small and doesn't auto resize. When I use p:dialog everything works fine and the height adjust as it should.

How can I make the dialog resize it's height on validation errors?

Before Validation Errors:
Image

After Validation Errors:
Image

init dialog Framework

Code: Select all

Map<String, Object> options = new HashMap<>();
		options.put("modal", true);
		options.put("resizable", false);
		options.put("draggable", false);
		options.put("responsive", true);
		options.put("contentWidth", "auto");
content.html

Code: Select all

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Titel</title>
</h:head>

<h:body>
	<h:form id="form">
		<p:messages id="messages">
			<p:autoUpdate />
		</p:messages>
		<h:panelGrid cellpadding="5" columns="1">
			<p:inputText value="#{dialogService.value}" required="true"
				requiredMessage="No Value" />
			<p:commandButton value="Submit" update="form" />
		</h:panelGrid>
	</h:form>

</h:body>
</html>

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

12 Mar 2019, 15:55

Hmm to me this seems like a bug if the height is auto it should act the same as the regular p:dialog. I would report a defect on the GitHub issues page.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1


pfroy
Posts: 49
Joined: 09 Sep 2015, 18:20

30 Sep 2019, 23:06

Did someone ever got a solution for this one? Maybe triggering the resize when clicking a dialog button? Please help. I opened a similar question on the forum.

viewtopic.php?f=3&t=60084

Regards,
Pierre
Primefaces 12.0
Jakarta Faces 4.0
Oracle JDK 17
Payara 6.2023.6
Jakarta EE 10.0

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests