2 Replies Latest reply on Jul 9, 2007 6:11 PM by John McClain

    question on injection with multiple forms

    John McClain Newbie

      I am getting the following error and would like to know why:
      Caused by: org.jboss.seam.RequiredException: In attribute requires non-null value: indexPage.property
      at org.jboss.seam.Component.getValueToInject(Component.java:1919)
      at org.jboss.seam.Component.injectAttributes(Component.java:1368)
      at org.jboss.seam.Component.inject(Component.java:1195)
      at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)

      I have an xhtml page with 3 forms and 1 session bean that gets injected with entity beans for each form. When I submit the the borrower form, I get the above exception.

      I have the following statless session bean

      @Stateless
      @Name("indexPage")
      public class IndexPageBean implements IndexPage {
      
       @Logger
       private Log log;
      
       @In
       FacesMessages facesMessages;
      
       @In(create=true)
       private Property property;
      
       @In(create=true)
       private Borrower borrower;
      
       @In(create=true)
       private LoanApplication loanApplication;
      .
      .
      .
      


      and the folowing facelet code
       <div id="Borrower">
       <h2>Borrower</h2>
       <form name="BorrowerForm" id="BorrowerForm" jsfc="h:form">
       <div id="ageDiv">
       <label>AGE:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{Borrower.age}"/>
       </label>
       </div>
       <div id="grossIncomeDiv">
       <label>GROSS:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{Borrower.grossIncome}"/>
       </label>
       </div>
       <div id="submitBorrower">
       <input type="submit" jsfc="h:commandButton" id="submitBorrowerButton" action="#{indexPage.submitBorrower}" value="Submit" />
       </div>
       </form>
       </div>
      
       <div id="Property">
       <h2>Property</h2>
       <form name="PropertyForm" id="PropertyForm" jsfc="h:form">
       <div id="typeDiv">
       <label>TYPE:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{Property.type}"/>
       </label>
       </div>
       <div id="purposeDiv">
       <label>PURPOSE:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{Property.purpose}"/>
       </label>
       </div>
       <div id="zipDiv">
       <label>ZIP:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{Property.zipCode}"/>
       </label>
       </div>
       <div id="yearDiv">
       <label>YEAR:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{Property.yearBuilt}"/>
       </label>
       </div>
       <div id="submitProperty">
       <input type="submit" jsfc="h:commandButton" id="submitPropertyButton" action="#{indexPage.submitProperty}" value="Submit" />
       </div>
       </form>
       </div>
      
       <div id="LoanApp">
       <h2>Loan Application</h2>
       <form name="LoanAppForm" id="LoanAppForm" jsfc="h:form">
       <div id="loanAmountDiv">
       <label>LoanAmount:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{LoanApplication.loanAmount}"/>
       </label>
       </div>
       <div id="submitProperty">
       <input type="submit" jsfc="h:commandButton" id="submitPropertyButton" action="#{indexPage.submitLoanApplication}" value="Submit" />
       </div>
       </form>
       </div>