confirmDialog modal="true" not working with 2.2.M1

UI Components for JSF
Post Reply
malagon
Posts: 24
Joined: 16 Jul 2010, 16:48

30 Sep 2010, 19:25

Hello anybody!

I'm working with PR 2.2.M1 version and I saw the use example from last showcase.

Well, all works fine whit the next code, without modal attribute (I guess that its modal="false")

Code: Select all

<p:commandButton value="#{msg.com_eliminar}" onclick="confirmation.show()" />  
       
    <p:confirmDialog message="#{msg.dlg_del_msg_content}"  
                header="#{msg.dlg_del_msg_header}" severity="alert" widgetVar="confirmation">  
                   
        <p:commandButton value="#{msg.dlg_msg_si}" update="msgs, mensajes, growl" oncomplete="confirmation.hide()"  
                    actionListener="#{mensajesEnviadosRecibidosBean.eliminarMensajes}" />  
        <p:commandButton value="#{msg.dlg_msg_no}" onclick="confirmation.hide()" type="button" />    
                   
    </p:confirmDialog>
When I insert modal attribute, modal = "true", it doesn't works fine. When I click over commandButton that has actionListener (AJAX) de ajax call is done two times towards my managed bean method!. But, it is not all, this happen on internet explorer (I'm using IE 8 version) and not in Mozilla!

Code: Select all

<p:commandButton value="#{msg.com_eliminar}" onclick="confirmation.show()" />  
       
    <p:confirmDialog message="#{msg.dlg_del_msg_content}"  modal="true"
                header="#{msg.dlg_del_msg_header}" severity="alert" widgetVar="confirmation">  
                   
        <p:commandButton value="#{msg.dlg_msg_si}" update="msgs, mensajes, growl" oncomplete="confirmation.hide()"  
                    actionListener="#{mensajesEnviadosRecibidosBean.eliminarMensajes}" />  
        <p:commandButton value="#{msg.dlg_msg_no}" onclick="confirmation.hide()" type="button" />    
                   
    </p:confirmDialog>
It's a rare behaviour! I don't understand it!

Can anybody help me?

Thanks for all!

malagon
Posts: 24
Joined: 16 Jul 2010, 16:48

01 Oct 2010, 11:29

Can anybody help me?

Anybody knows this issue?

chang82
Posts: 7
Joined: 27 Jul 2010, 16:21

14 Oct 2010, 10:22

Hi,

I faced the same problem as well.
When set modal="true", the ajax call is done twice to the backing bean.
and it happens in IE 7 and IE 8.
Tested working fine in FF 3 and Chrome.
It works well in IE 7 and 8 without the modal="true".

i am using Primefaces 2.2 RC 1 Snapshot

Hope anyone can help us out.

Thanks.

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

14 Oct 2010, 10:43

Hello,

Try to place your p:confirmDialog close to the body tag. It should help for IE.
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

chang82
Posts: 7
Joined: 27 Jul 2010, 16:21

14 Oct 2010, 11:19

hi,

thanks for your response.

the <p:dialog> is also having same behaivour with modal="true" (tested in IE 7 and 8)
other browsers working fine.

my code looks like this:

Code: Select all

<div>
<h:form>
    <p:commandButton value="Add New" onclick="dlgAdd.show();" type="button" image="addNew"/>
</h:form>
<div>

<p:dialog id="addSystem" header="Add New System" widgetVar="dlgAdd" modal="true"
	height="400" width="450" showEffect="fade" hideEffect="fade" resizable="true">
       <p:ajaxStatus style="width:16px;height:16px;">  
		<f:facet name="start">  
			<h:graphicImage value="design/ajaxloading.gif" />
		</f:facet>  
		<f:facet name="complete">  
			<h:outputText value="" />  
		</f:facet>  
	</p:ajaxStatus>
	<h:form prependId="false" id="frmAdd">
		<h:panelGrid columns="2" cellpadding="5" styleClass="popupTable">		
			<h:panelGroup>
                                  <h:outputLabel for="systemName" value="System Name " />
                                  <h:outputText styleClass="emRequired" value="*"/>
                        </h:panelGroup>
             			
             		<h:outputLabel value="" />
             		<h:panelGroup>
             			<p:commandButton value="Add" actionListener="#{projectManager.addSystem}" 
                                          update="frmAdd" />                            
                                 <p:spacer height="10" width="10"/>
             			 <p:commandButton value="Reset" type="Reset" ajax="false" /> <p:spacer height="10" width="10"/>
             			 <p:commandButton value="Cancel" type="button" ajax="false" onclick="dlgAdd.hide();" />
             			</h:panelGroup>
		</h:panelGrid>
		<h:outputText styleClass="emRequired" value="* Required Field" />
	</h:form>
</p:dialog>
my backing bean

Code: Select all

public void addSystem(ActionEvent actionEvent)
{
        int status = ProjectController.addProject(project);
	
	if(status>0) //id > 0 means add success
	{
		//add success message
		FacesContext.getCurrentInstance().addMessage(null, 
				new FacesMessage(FacesMessage.SEVERITY_INFO, "Add Success", 
				"Project information added"));
	}
	else //add failed (can use custom integer message to display specific messages)
	{
		FacesContext.getCurrentInstance().addMessage(null, 
				new FacesMessage(FacesMessage.SEVERITY_ERROR, "Add Failed", 
				"Unable to add project Information"));
	}
}
the project record was saved twice in the database when testing with IE 7 and 8.
its working fine for other browsers.

i tried to put the <p:dialog> close to boday tag as well, but the problem was not solved.

I would appretiate alot if anyone can figure out where is my mistake in the code.

Thanks

callahan
Posts: 768
Joined: 27 May 2010, 22:52

14 Oct 2010, 13:32

Hi,

The problem may not be in your code. There have been several posts about issues with IE and modal dialogs recently. For example:

http://primefaces.prime.com.tr/forum/vi ... f=3&t=3577
http://primefaces.prime.com.tr/forum/vi ... f=3&t=4236

The second link discusses a workaround that uses h:commandLinks instead of p:commandButtons. Perhaps the workaround would work for you also.

There is also this issue which you could vote for http://code.google.com/p/primefaces/iss ... il?id=1147

chang82
Posts: 7
Joined: 27 Jul 2010, 16:21

18 Oct 2010, 04:32

hi,
thanks alot for your links.

i did according to the workaround that uses h:commandLinks instead of p:commandButtons.
it fixes the problem in IE for now. I do hope the problem with <p:commandButton> can be resolved as well soon.

thanks again for your helps!

callahan
Posts: 768
Joined: 27 May 2010, 22:52

18 Oct 2010, 08:06

No problem ;) .

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests