problem with <p:commandButton> -> confirmDialog

UI Components for JSF
edmund-wagner
Posts: 18
Joined: 18 Jan 2010, 14:35

21 Jan 2010, 11:26

using the code below i get bad rendered (missing buttons, see screenshot) confirmation dialogs of <p:commandButton>
when i use the add <p:commandButton> sometimes the remove works again for a specific amout of table elements.
seems to be a problem with multiple confirm dialog instances. another problem is that i can't set it to modal else the whole window is locked (only for bad rendered confirm dialogs).

Image

Code: Select all

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui" template="template.xhtml">
	<ui:define name="content">
			<p:messages />
			<p:panel id="panel" header="sharelist">
				<p:dataTable id="table" scrollable="false" value="#{shares.shares}"
					var="share">
					<p:column width="600" sortBy="#{share}">
						<f:facet name="header">
							<h:outputText value="Name" />
						</f:facet>
						<h:outputText value="#{share}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="" />
						</f:facet>
						<h:form id="removeform">
							<p:commandButton value="del" action="#{shares.removeShare}" ajax="false" async="false">
								<p:collector value="#{share}" removeFrom="#{shares.shares}" />
								<p:confirmDialog yesLabel="yepp" noLabel="Noooo"  width="350px" fixedCenter="true" height="100px"   
									message="really?"   
									header="delete" severity="warn" /> 
							</p:commandButton>
						</h:form>
					</p:column>
				</p:dataTable>
			</p:panel>
			<h:form>
				<p:panel id="p2" header="create share">
					<h:panelGrid columns="2">
						<h:outputLabel value="Name : *"></h:outputLabel>
						<h:inputText id="txt_sharename" value="#{shares.shareName}"
							required="true" />
						<h:outputLabel value="User : *"></h:outputLabel>
						<h:inputText id="txt_usrname" value="#{shares.shareUser}"
							required="true" />
						<h:panelGroup>
							<p:commandButton value="add" action="#{shares.addShare}" update="panel">
								<p:collector value="#{shares.shares}" addTo="#{shares.shares}" />
								<p:confirmDialog yesLabel="yepp" noLabel="Noooo"  width="350px" fixedCenter="true" height="100px"   
									message="really?"   
									header="add" severity="warn" /> 
							</p:commandButton>
						</h:panelGroup>
					</h:panelGrid>
				</p:panel>
			</h:form>
	</ui:define>
</ui:composition>

edmund-wagner
Posts: 18
Joined: 18 Jan 2010, 14:35

21 Jan 2010, 11:29

still using my jsf2.0 primefaces setup :)

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Jan 2010, 13:15

Does confirmDialog work when you use it outside datatable, basically I don't suggest using confirm dialog inside data iterating components like datatable for performance reasons and other possible issues like thus. Regular return confirm() javascript api is more suitable in datatable.

edmund-wagner
Posts: 18
Joined: 18 Jan 2010, 14:35

22 Jan 2010, 17:26

did not experience any problems outside datatable. jepp js confirm is my current workaroud for that problem. performance is not a problem in my case, confirmdialog just looks much better :)

sky_java_seb
Posts: 10
Joined: 20 Mar 2010, 03:12

03 May 2010, 16:37

Hello,

I raise this thread because it seems I have a similar problem that's surely linked.

If I use confirmDialog nested in a commandLink inside a primefaces dataTable the link simply do nothing and no dialog becomes visible... on IE 7 :roll:
All's right with latest Firefox, I didn't try with Safari nor opera etc.
This use case seems linked to issue 534 for my eyes... but it seems there's no progress on it :(

If it can help for a debug I can add as a feedback that it seems to work if we swap a primefaces dataTable for a basic JSF one

I use Glassfish v3, JSF 2.0 Mojarra, Primefaces 2.0.2 SNAP

thanks in advance for any linked news ;)

egbokul
Posts: 30
Joined: 11 May 2010, 15:39

11 May 2010, 16:04

+1
when the confirmDialog is not modal then the buttons do work, but the dialog is automatically resized to a certain value, and the "width" attribute doesn't seem to have any effect.
Also dragging is disabled regardless of the attribute.
I've tested it on Firefox 3.6.
Displaying a normal dialog works, but it's a bit more uncomfortable in this case.

btw. an excerpt from the Primefaces Users Guide:
ConfirmDialog is a replacement to the legacy javascript confirmation box. Its main use is to
have the user do a binary decision(either yes or no). Skinning, customization and avoiding
popup blockers are some the advantages over classic javascript confirmation.

egbokul
Posts: 30
Joined: 11 May 2010, 15:39

11 May 2010, 17:08

The same behaviour was encountered when replacing dataTable with ui:repeat and accordionPanel.

It seems to me that this is the Achilles heel of Primefaces... well, could be worse :-)

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 May 2010, 00:58

Hi,

I would not suggest embedding a confirmDialog inside a dialog as it might cause weird issues like this.

Instead we'll extract the confirmDialog to a standalone component, that will fix these issues hopefully, there is one issue in tracker regarding this.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

13 May 2010, 14:35

cagatay.civici wrote:Hi,

I would not suggest embedding a confirmDialog inside a dialog as it might cause weird issues like this.

Instead we'll extract the confirmDialog to a standalone component, that will fix these issues hopefully, there is one issue in tracker regarding this.
Hi,

I have extracted the confirmDialog to a standalone component. It works fine, I can use modal mode together with layout, etc. I can even replace the message text of the confirmDialog dynamically :-) That means, you have just one dialog on the page for several messages. Of course you have to extend some components like command components and menitem to additional attributs like confirmDialogId, yes-, noLabel or messageConfirmDialog. I have done this for menuitem at the moment (no needs for command components). I could provide these components if something like sandbox would existing for SVN checkin.

Best regards.
Oleg.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

egbokul
Posts: 30
Joined: 11 May 2010, 15:39

25 May 2010, 09:24

Primefaces 2.0.2 fix report:
modal confirmDialogs still don't work.

However, non-modal confirmDialog displays correctly.
If invoked from a table, then it is not draggable, but otherwise seems to work!
If invoked from a layout, even dragging works fine.

This is a nice improvement, hopefully in 2.0.3 we'll have a fully working confirmDialog! ;-)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests