[jboss-user] [JBoss Seam] - @DataModelSelection defaults to first value in model??

edeprez do-not-reply at jboss.com
Thu Mar 1 05:22:22 EST 2007


Very simple use case. I've a DataModel, initialized through @Factory. It is never empty at first.

  | @DataModel
  | private List<Item> items;
  | @DataModelSelection  @Out(required=false)  
  | private User selItem;
  | 

I'd like to invite the user to select an item in the list when no selection is active. But my selItem is never empty at first page hit! It defaults to first value in DataModel! So it's just like the user has already made a selection. Which is wrong!

Is there a reason why this is working like this? Or maybe I'm missing something. It's so simple it's very frustrating.

Also, when I add 

  | @DataModelSelectionIndex
  | private int selIndex;
  | 
I get the following exception when deploying:
java.lang.IllegalStateException: Multiple @DataModelSelection fields for: items

Is this expected behaviour?

Thanks!


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

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



More information about the jboss-user mailing list