You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Rogério Pereira Araújo (JIRA)" <de...@myfaces.apache.org> on 2006/06/23 16:48:30 UTC

[jira] Resolved: (MYFACES-1312) dependency injection error with ArrayList

     [ http://issues.apache.org/jira/browse/MYFACES-1312?page=all ]
     
Rogério Pereira Araújo resolved MYFACES-1312:
---------------------------------------------

    Fix Version:     (was: 1.1.4-SNAPSHOT)
     Resolution: Won't Fix

The <t:saveState/> in one of the beans is the cause of this bug, after some hack the error gone.

> 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
>  Attachments: faces-config.xml
>
> 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