Hello I want to select an object from a Datatable via the DataModel and the 
DataModelSelectionIndex like in the booking example.
I always get an Exception :
....attempted to bind an Out attribute of the wrong type to: contributable...
My Class looks like this

  | @Stateful
  | @Name("findContributables")
  | @Interceptor(SeamInterceptor.class)
  | public class FindContributablesAction implements FindContributables, 
Serializable
  | {
  |     
  |     
  |     private static final long serialVersionUID = -6803933802941651662L;
  |     
  | 
  | 
  |     @PersistenceContext(type=EXTENDED)
  |     private EntityManager em;
  |        
  |     @DataModel
  |     private List<Object> contributables;
  |     @DataModelSelectionIndex
  |     private int contributableIndex;
  |      
  |     @Out 
  |     private Object contributable;
  |         ....
  | 
  | 

and the method invoked in the Datatable is selectContributable()


  |     public String selectContributable()
  |        {  
  |           if (contributables==null) return "contributableList";
  |           try{
  |               setContributable(); 
  |                  }catch(Exception 
e){System.out.println(e+"@selectContributable");}
  |                 System.out.println("Contributable was selected 
@setContributable"); 
  |           return "contributableSelected";
  |        }
  |     
  |      private void setContributable(){  
  |          try{
  |              contributable = contributables.get(contributableIndex); 
  |          }catch(Exception 
e){System.out.println(e.toString()+"@setContributable");}
  |          System.out.println("Contributable #"+contributableIndex+" was set 
@setContributable" +contributable.toString());
  |        }
  | 
 
The DataTable is generated by this method in the same class
The EntityManger return here a List of several Object form the type Journal ect.
        
  |     public List<Object> getAllContributables() {
  |             String[] types = {"Journal", "Book", "Workshop", "Conference"};
  |             List<Object> list = null;
  |             try {
  |                     ContributableManager cm = new 
ContributableManagerBean(em);
  |                     for (int i=0; i<types.length; i++) {
  |                             List<Object> templist = 
cm.findContributable(types, null);
  |                             if (list == null) {
  |                                     list = templist;
  |                             }
  |                             else {
  |                                     list.addAll(templist);
  |                             }
  |                     }
  |             }
  |             catch (Exception e) {
  |             }
  |             contributables = list;
  |             return list;
  |     }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3918218#3918218

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3918218


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to