Details
Description
Under certain conditions, the ViewState may not get written to the page/form which causes a problem when navigating. The typical result is that every second click of a button that triggers navigation doesn't appear to work. The problematic behaviour is actually seen in Mojarra 2.0.2 without ICEfaces. The conditions required are:
The page starts with the XML preamble like: <?xml version="1.0" encoding="UTF-8"?>
The form does not have a specific id set on it: <h:form prependId="false">
The button is Ajax-enabled with render all:
<h:commandButton id="navButton" value="Go to Page 2" action="page02">
<f:ajax render="@all"/>
</h:commandButton>
So given a couple of simple pages like this that navigate back and forth to each other:
<?xml version="1.0"?>
<!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">
<h:head>
<title>Ajax Navigation</title>
</h:head>
<h:body>
<h:form prependId="false">
<p>
<h:commandButton id="navButton" value="Go to Page 2" action="page02" >
<f:ajax render="@all"/>
</h:commandButton>
</p>
</h:form>
</h:body>
</html>
will result in every second click failing.
The page starts with the XML preamble like: <?xml version="1.0" encoding="UTF-8"?>
The form does not have a specific id set on it: <h:form prependId="false">
The button is Ajax-enabled with render all:
<h:commandButton id="navButton" value="Go to Page 2" action="page02">
<f:ajax render="@all"/>
</h:commandButton>
So given a couple of simple pages like this that navigate back and forth to each other:
<?xml version="1.0"?>
<!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">
<h:head>
<title>Ajax Navigation</title>
</h:head>
<h:body>
<h:form prependId="false">
<p>
<h:commandButton id="navButton" value="Go to Page 2" action="page02" >
<f:ajax render="@all"/>
</h:commandButton>
</p>
</h:form>
</h:body>
</html>
will result in every second click failing.
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion