12 Replies Latest reply on May 7, 2008 2:05 PM by trixom

    PropertyNotFoundException Using ui:include

    stevedroy

      Hello,


      I have setup a bean with conversational scope. I am finding a facelet page included in the main facelet page via ui:include can't access the conversational bean when the page is built during the RESTORE VIEW phase.  The PropertyNotFoundException is thrown. 


      Does something special need to be done to the conversational backing bean available to the included page?



      The include reference:


      |<ui:include   src="/common/includes/myincludeComponent.xhtml">
        <ui:param name="workflow" value="true"></ui:param>
      </ui:include>
      |




      The Exception:

      |
      10:19:19,619 WARN  [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@1c4650e) threw exception
      javax.el.PropertyNotFoundException: /common/includes/myincludeComponent.xhtml @21,43 binding="#{myBean.serviceSelectionDataTable}": Target Unreachable, identifier 'myBean' resolved to null
      |





      Bean Declaration:

      @Name("myBean")
      @Scope(ScopeType.CONVERSATION)
      public class MyBean extends MyBeanSuperclass {
      




      Thank You,
      - steve

        • 1. Re: PropertyNotFoundException Using ui:include
          keithnaas

          Does it work if you add an @AutoCreate annotation to MyBean?

          • 2. Re: PropertyNotFoundException Using ui:include
            stevedroy

            Thanks but still the same result.

            • 3. Re: PropertyNotFoundException Using ui:include
              keithnaas

              Can you show the contents of myincludeComponent.xhtml?

              • 4. Re: PropertyNotFoundException Using ui:include
                stevedroy

                It's somewhat lengthy, but here is the section in question. 





                     <t:div styleClass="wide wideList">                         
                     <t:div styleClass="bottom">
                     
                               <t:div styleClass="wideRightPerson">
                               <rich:scrollableDataTable 
                                    id="personList" 
                                    height="190px" width="516px"
                                    binding="#{myBean.personSelectionDataTable}"
                                    value="#{myBean.persons}" var="person" 
                                    rows="50" sortMode="single" 
                                    styleClass="personTable" 
                                    headerClass="personHead" 
                                    columnClasses="personBorderPatrol">
                                    
                                    <rich:column id="editPersonCol" width="30px" styleClass="#{person.active == 'true' ? 'edit' : 'editinactive'}">
                                         <f:facet name="header">
                                              <rich:spacer height="20" />
                                              <h:outputText styleClass="headerText" value=" " />
                                         </f:facet>
                                         <a4j:commandLink value="#{personSelBundle.EditPersonLink}" action="#{personSelectionBean.showEditDialog}" oncomplete="javascript:showEditModalDialog();" reRender="title,clientPanel,personPanel,hdnClientId,hdnPersonId,hdnClientIsDisabled, errorPanel, messageCount, title, adminErrorPanel" styleClass="text" />
                                    </rich:column>
                



                This part is not evaluating according to the stack trace:  



                "binding="#{myBean.personSelectionDataTable}"

                • 5. Re: PropertyNotFoundException Using ui:include
                  keithnaas

                  Ahhh...a binding on a JSF control is not supported for Conversational components.  The Seam docs recommend not using bindings at all if you can get away with it.  We have developed 3 large applications without the need for them.


                  See 6.8. Conversational components and JSF component bindings

                  • 6. Re: PropertyNotFoundException Using ui:include
                    stevedroy

                    Thanks!  That would explain it.


                    The section in the reference guide is rather brief.  Are you aware of an expanded example I could study? 


                    We are looking at introducing Seam to an application in production and it may be tough to get buy in to remove the RichFaces scrollableDataTable.


                    Thank You,
                    steve

                    • 7. Re: PropertyNotFoundException Using ui:include
                      keithnaas

                      Its still possible to use the scollableDataTable without a binding.  I assume that you are using a binding so that the backing bean can modify the view state somehow?  If it is being used to track the current selected row, use the DataModel and DataModelSelection annotations.  If it is to change the contents of the scrollableDataTable, just rerender it when a user clicks the relevant actions. 


                      What is the use case for needing the binding?

                      • 8. Re: PropertyNotFoundException Using ui:include
                        stevedroy

                        Getting back to the reference of:


                        See 6.8. Conversational components and JSF component bindings


                        In the example code and the narrative, it is not apparent how the     htmlPanelGrid becomes set in the event scoped bean.   Is it supposed to be injected by Seam or does it become the new value for the binding expression?


                        - steve

                        • 9. Re: PropertyNotFoundException Using ui:include
                          keithnaas

                          Methinks it is the new value of the binding expression otherwise how will it know what to bind to?


                          Keith

                          • 10. Re: PropertyNotFoundException Using ui:include
                            stevedroy

                            I just wanted to check because that technique does not seem to work.

                            • 11. Re: PropertyNotFoundException Using ui:include
                              trixom

                              Hi,


                              I am having the same problem, here is my code:


                              <rich:scrollableDataTable
                                 binding="#{parentList.table}"
                                 value="#{parentList.countries}" 
                                 var="country"
                                 height="200px"
                                 width="540px"
                                 selection="#{parentList.selectedCountries}"
                                 rendered="#{not empty parentList.countries}">
                                 <a:support 
                                   action="onselectionchange 
                                   reRender="countryMenuPanel, countrySubPanel" />
                              



                              What I am trying to do is get the selected

                              • 12. Re: PropertyNotFoundException Using ui:include
                                trixom

                                Hi,


                                I am having the same problem, here is my code:


                                <rich:scrollableDataTable
                                   binding="#{parentList.table}"
                                   value="#{parentList.countries}" 
                                   var="country"
                                   height="200px"
                                   width="540px"
                                   selection="#{parentList.selectedCountries}"
                                   rendered="#{not empty parentList.countries}">
                                   <a:support 
                                     action="onselectionchange 
                                     reRender="countryMenuPanel, countrySubPanel" />
                                



                                What I am trying to do is get the selectedCountries to fire when I change the selection.


                                As soon as I use ajax to do this the scope is lost.


                                Thanks,


                                Tom