This content has been marked as final.
Show 8 replies
-
1. Re: DataModelSelection is null
tim_ph Aug 7, 2007 4:12 PM (in response to ilya78)try scope CONVERSATION or wider
-
2. Re: DataModelSelection is null
ilya78 Aug 7, 2007 5:19 PM (in response to ilya78)"tim_ph" wrote:
try scope CONVERSATION or wider
Thanks, I have tried: It only works with session and long running conversation.
But using such a wider scope introduces more complications, like ending the conversation, cleaning the data from the session, etc.
I understood from the docs that Page scope was designed to do just this - persist the data to the client to be available to the next request. -
3. Re: DataModelSelection is null
pmuir Aug 8, 2007 5:22 AM (in response to ilya78)Yes, that is what PAGE scope does. So use it.
-
4. Re: DataModelSelection is null
ilya78 Aug 8, 2007 5:26 AM (in response to ilya78)"pete.muir@jboss.org" wrote:
Yes, that is what PAGE scope does. So use it.
But it does not work with DataModel - I've posted above the example that is not working. -
5. Re: DataModelSelection is null
ilya78 Aug 8, 2007 5:28 AM (in response to ilya78)"ilya78" wrote:
"pete.muir@jboss.org" wrote:
Yes, that is what PAGE scope does. So use it.
But it does not work with DataModel - I've posted above the example that is not working.
It is a mistake in the example above, the correct is :
@DataModel(value="eventList", scope=ScopeType.PAGE)
This is what I am trying and is not working (sorry for the confusion) -
6. Re: DataModelSelection is null
ilya78 Aug 9, 2007 11:26 AM (in response to ilya78)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. -
-
8. Re: DataModelSelection is null
amitev Aug 28, 2007 9:54 AM (in response to ilya78)Btw today i had a similar issue with page scoped dataModel but i was passing the object as method param with el <s:link action="#{eventLister.selectEvent(item)}" value="#{item}"/> like this and the same issue as here occured.