-
Bug
-
Resolution: Done
-
Major
-
22.0.0.Beta1
-
None
I still have a problem with JSF 2.3 related to ViewParam, I tested it with WildFly 21 and the bug is still there.
Note that Wildfly already incorporated all the fixes recently done by @soul2zimate
When you click on button the second time a exception happens, this is not the case when using mojarra 2.2, myfaces 2.2 or myfaces 2.3
url to test: http://localhost/project-0.0.1-SNAPSHOT/test.xhtml
XHTML:
<f:metadata> <f:viewParam id="id" name="id" value="#{testView.testClass.id}" /> </f:metadata> <h:form> <p:commandButton update="@form" /> <p:dataTable var="m" selectionMode="single" selection="#{testView.testClass}" rowKey="#{m.id}" value="#{testView.testClasses}"> </p:dataTable> </h:form>
beans
import java.io.Serializable; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.view.ViewScoped; import javax.inject.Named; @Named @ViewScoped public class TestView implements Serializable { private TestClass testClass; private List<TestClass> testClasses; @PostConstruct public void init() { testClass = new TestClass(); } public TestClass getTestClass() { return testClass; } public void setTestClass(TestClass testClass) { this.testClass = testClass; } public List<TestClass> getTestClasses() { return testClasses; } public void setTestClasses(List<TestClass> testClasses) { this.testClasses = testClasses; } }
model
public class TestClass { Integer id; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } }
You also need to set in web.xml the following param
<context-param> <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> <param-value>true</param-value> </context-param>
- is incorporated by
-
WFLY-14401 Upgrade Mojarra to 2.3.14.SP04
- Closed