[jboss-user] [JBoss Seam] - Strange behaviour in 2.0.0beta1

rmemoria do-not-reply at jboss.com
Thu Jun 28 12:41:50 EDT 2007


I've been upgrading since version 1.2.1 and in version 2.0.0.beta1 I found something very strange:

I have a long running conversation with an EntityHome bean like that:

@Name("recebimentoHome")
  | public class RecebimentoHome extends EntityHome<Recebimento> {
  | 
  | private ItemRecebimento itemRec;
  | 	
  | @Factory("recebimento")
  | public Recebimento getRecebimento() {
  | 	return getInstance();
  | }
  | 
  | public ItemRecebimento getItem() {
  | 	if (itemRec == null) {
  | 		itemRec = new ItemRecebimento();
  | 	}
  | 	
  | 	return itemRecebimento;
  | }
  | 
  | public void addNewItem() {
  | 	getInstance().getItens().add(itemRec);
  | 	itemRec = null;
  | }
  | ..
  | ..
  | ..

So when the addNewItem() is called from a button, the property recebimentoHome.item should return a new item, but in fact, after calling addNewItem() the property itemRec is restored to the previous value . The same before calling addNewItem().

Any tip?

Regards,
Ricardo Memória

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

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




More information about the jboss-user mailing list