dependency injection error with ArrayList
-----------------------------------------

         Key: MYFACES-1312
         URL: http://issues.apache.org/jira/browse/MYFACES-1312
     Project: MyFaces Core
        Type: Bug

  Components: JSR-127  
    Versions: 1.1.3    
    Reporter: Rogério Pereira Araújo
     Fix For: 1.1.4-SNAPSHOT


I have 3 beans: beanA, beanB (ArrayList) and beanC, i add some items on beanB 
from beanA and i need remove few others from beanC, but when i try remove from 
beanC i'm getting a IndexOutOfBounds exception.

beanA and beanC is at request scope and beanB is at session scope.

Look this code:

public beanA
{
     private ArrayList beanB;

     public beanA()
     {

     }

     public String addItem()
     {
         if(beanB == null)
             setBeanB(new ArrayList());

         beanB.add("newItem");
         return null;
     }

     public void setBeanB(ArrayList beanB)
     {
          this.beanB = beanB;
     }
}


public beanC
{
     private ArrayList beanB;

     public beanC()
     {

     }

     public void removeItem(ActionEvent event)
     {
         beanB.remove(myDataTable.getRowIndex());
         return null;
     }

     public void setBeanB(ArrayList beanB)
     {
          this.beanB = beanB;
     }
}

i haven't added get/set stuff of myDataTable to keep the example simple.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to