myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Andraschko (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Comment Edited] (MYFACES-4268) Opening a dynamic dialog from a command with resetAttributes="true" makes a duplicated POST request.
Date Sat, 24 Nov 2018 10:11:00 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-4268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16697741#comment-16697741
] 

Thomas Andraschko edited comment on MYFACES-4268 at 11/24/18 10:10 AM:
-----------------------------------------------------------------------

First of all, the example is invalid because the commandButton is not inside a form, which
leads to a post without viewstateid. This is also not related to MyFaces.

After changing to:
{code:java}
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:p="http://primefaces.org/ui">

 <f:view>
  <h:head />
  <h:body>
	    <h:form id="form">  
	            <p:commandButton title="Show" process="@this" update="@form" resetValues="true"
oncomplete="PF('dialogWidget').show()" />
	            <p:dialog id="dialog" widgetVar="dialogWidget" dynamic="true">  

				<p:outputLabel for="@next" value="Label" />
				<p:inputText required="true" />
				<p:commandButton value="Submit" update="@form" />
	          </p:dialog> 
	    </h:form>  
  </h:body>
 </f:view>
</html>
{code}
there are still 2 requests but they are expected from PrimeFaces side.


was (Author: tandraschko):
First of all, the example is invalid because the commandButton is not inside a form, which
leads to a post without viewstateid. This is also not related to PrimeFaces.

After changing to:


{code:java}
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:p="http://primefaces.org/ui">

 <f:view>
  <h:head />
  <h:body>
	    <h:form id="form">  
	            <p:commandButton title="Show" process="@this" update="@form" resetValues="true"
oncomplete="PF('dialogWidget').show()" />
	            <p:dialog id="dialog" widgetVar="dialogWidget" dynamic="true">  

				<p:outputLabel for="@next" value="Label" />
				<p:inputText required="true" />
				<p:commandButton value="Submit" update="@form" />
	          </p:dialog> 
	    </h:form>  
  </h:body>
 </f:view>
</html>
{code}

there are still 2 requests but they are expected from PrimeFaces side.

> Opening a dynamic dialog from a command with resetAttributes="true" makes a duplicated
POST request.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-4268
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4268
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.3.2
>            Reporter: Antgar
>            Priority: Minor
>
> If a dynamic dialog containing a form is oppened from a command with resetValues set
to true, two POST requests are made returning the same information. It should be loaded only
once.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message