Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-13691

PropertyNotFoundException when nested entity is null

    XMLWordPrintable

    Details

      Description

      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>

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              soul2zimate Chao Wang
              Reporter:
              erick.de.oliveira.leal erick leal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: