[jboss-user] [JBoss Seam] - Re: DataModelSelection is null

ilya78 do-not-reply at jboss.com
Thu Aug 9 11:26:15 EDT 2007


Can please someone help me out. Here is a simple application to reproduce just the problem:


  | @Name("eventLister")
  | @Scope(ScopeType.EVENT)
  | public class EventListerAction implements Serializable {
  | 	
  | 	@In FacesMessages facesMessages;
  |     
  |     @DataModel(value="eventList", scope=ScopeType.PAGE)
  |     private List<Integer> eventList;
  |     
  |     @DataModelSelection
  |     private Integer selectedEvent;
  |     
  |     @Factory("eventList")
  |     public void initRequestList() {
  |     	eventList = new ArrayList<Integer>();
  |     	eventList.add(1);
  |     	eventList.add(2);
  |     	eventList.add(3);
  |     }
  |     public void selectEvent() {
  |         facesMessages.add("selected event: "+selectedEvent);
  |     }    
  |    
  | }
  | 

and eventList.xhtml:


  | <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  |                 xmlns:s="http://jboss.com/products/seam/taglib"
  |                 xmlns:ui="http://java.sun.com/jsf/facelets"
  |                 xmlns:f="http://java.sun.com/jsf/core"
  |                 xmlns:h="http://java.sun.com/jsf/html"
  |                 template="layout/template.xhtml">
  |                        
  | <ui:define name="body">
  | 
  |     <h:messages globalOnly="true" styleClass="message"/>
  | 
  | 	<h:dataTable value="#{eventList}" var="item" >
  | 				<h:column>
  | 					<f:facet name="header">Event</f:facet>
  | 					<s:link action="#{eventLister.selectEvent}" value="#{item}"/>
  | 				</h:column>
  | 	</h:dataTable> 
  | </ui:define>
  | 
  | </ui:composition>
  | 


The problem is that when I call selectEvent, the DataModelSelection is null. Please help.

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

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



More information about the jboss-user mailing list